<?php

session_start(); 

if(!isset($_SESSION['userName'])){

header( 'location:../index.php' ); 

}

include("../conf/connect.php");

	$serial=$_GET['serial'];

	$user_id = $_SESSION['user_id'];

	$hid = $_SESSION['usrHHid']; 

	$respondent = $_SESSION['hello'];

?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

	<title></title>

	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

	<link rel="stylesheet" type="text/css" href="../style.css" media="screen" />

	<link rel="shortcut icon" href="images/favicon.ico" />

</head>

<body class="iub_back">

	<?php if ($serial=='member'){ ?>

				<form action="answer.php?qus=member" method="post">

				<table align="center" class="table_border" >

					<tr align="left">

							<td align="left" valign="top"> Adult Mmbrs:</td>

					</tr>

					<?php

						$sql ="SELECT * FROM raw_data where user_id='$user_id' and hid='$hid'";

						$result=mysql_query( $sql);

					?>

					<tr>

							<td> Member: </td>

					</tr>

					<tr>

							<td>

								<input type="hidden" name="hid" value="<?php echo $hid; ?>" />

								<select name="memid">

								<?php

									

									$data;

									while($row = mysql_fetch_array($result)){

									$age=$row['q2'];

									$id=$row['id'];

									$stql ="SELECT * FROM med1 where user_id='$user_id' and hid='$hid' and resp_id='$id'";

									$stresult=mysql_query( $stql);

									$strow=mysql_fetch_array($stresult);

									$status=$strow['status'];

								?>

										<option value="<?php echo $row['id'];?>"><?php if($status=='1'||$age<18){echo 'x:&nbsp;';}echo $row['q1'];?></option>

								<?php

									}

								?>						

								</select>

							</td>

					</tr>

					<tr>

							<td  align="right">

								<input type="submit" value="Next" class="input-box" />&nbsp;

							</td>

					</tr>	

				</table>

		</form>

	<?php } ?>

	<?php if ($serial=='ed01'){ 

				$sql="SELECT ed01, ed02_1, ed02_2, ed02_3, ed03 FROM education WHERE hid = '$hid' and resp_id = '$respondent'";

				$result = mysql_query($sql) or die ("problem budget_heads");

				$row = mysql_fetch_assoc($result);

		?>

				<form action="answer.php?qus=ed01" method="post">

				<table align="center" class="table_border" >

					<tr align="left">

							<td align="left" valign="top"> Education:</td>

					</tr>

					<tr align="left">

							<td align="left" valign="top">ED01: Can you read a Bengali newspaper?</td>

					</tr>

					<tr align="left">

							<td align="left" <?php if($row['ed01'] == ''||$row['ed01'] == '0'){?>bgcolor="#F7A244"<?php }?>>

								<select name="ed01">

									 <?php

											if($row['ed01'] == ''||$row['ed01'] == '0'){

											 echo "<option value='0' selected='selected'> Select</option>";

											}

											else{

												$hop=$row['ed01'];

												$sql1="SELECT value from retreive_data WHERE qus='ed01' and hoption='$hop' ";

												$result1= mysql_query($sql1) or die ("problem 2ND BLOCK OF RESPONDENT");

												$value = mysql_fetch_assoc($result1);

												$mv= $value['value'];

												echo "<option value='$hop' selected='selected'> $hop-$mv</option>";

											}

										?>

									<option value="1">1-Easily</option>

									<option value="2">2-With difficulty</option>

									<option value="3">3-Unable</option>

								</select>					

							</td>

					</tr>

					<tr align="left">

							<td align="left" valign="top">ED02a: Can you write a letter in Bengali?</td>

					</tr>

					<tr align="left">

							<td align="left" <?php if($row['ed02_1'] == ''||$row['ed02_1'] == '0'){?>bgcolor="#F7A244"<?php }?>>

								<select name="ed02_1">

									 <?php

											if($row['ed02_1'] == ''||$row['ed02_1'] == '0'){

											 echo "<option value='0' selected='selected'> Select</option>";

											}

											else{

												$hop=$row['ed02_1'];

												$sql1="SELECT value from retreive_data WHERE qus='ed01' and hoption='$hop' ";

												$result1= mysql_query($sql1) or die ("problem 2ND BLOCK OF RESPONDENT");

												$value = mysql_fetch_assoc($result1);

												$mv= $value['value'];

												echo "<option value='$hop' selected='selected'> $hop-$mv</option>";

											}

										?>

									<option value="1">1-Easily</option>

									<option value="2">2-With difficulty</option>

									<option value="3">3-Unable</option>

								</select>					

							</td>

					</tr>

					<tr align="left">

							<td align="left" valign="top">ED02b: Can you do additions and subtractions?</td>

					</tr>

					<tr align="left">

							<td align="left" <?php if($row['ed02_2'] == ''||$row['ed02_2'] == '0'){?>bgcolor="#F7A244"<?php }?>>

								<select name="ed02_2">

									 <?php

											if($row['ed02_2'] == ''||$row['ed02_2'] == '0'){

											 echo "<option value='0' selected='selected'> Select</option>";

											}

											else{

												$hop=$row['ed02_2'];

												$sql1="SELECT value from retreive_data WHERE qus='ed01' and hoption='$hop' ";

												$result1= mysql_query($sql1) or die ("problem 2ND BLOCK OF RESPONDENT");

												$value = mysql_fetch_assoc($result1);

												$mv= $value['value'];

												echo "<option value='$hop' selected='selected'> $hop-$mv</option>";

											}

										?>

									<option value="1">1-Easily</option>

									<option value="2">2-With difficulty</option>

									<option value="3">3-Unable</option>

								</select>					

							</td>

					</tr>

					<tr align="left">

							<td align="left" valign="top">ED02c: Can you do divisions and multiplications?</td>

					</tr>

					<tr align="left">

							<td align="left" <?php if($row['ed02_3'] == ''||$row['ed02_3'] == '0'){?>bgcolor="#F7A244"<?php }?>>

								<select name="ed02_3">

									 <?php

											if($row['ed02_3'] == ''||$row['ed02_3'] == '0'){

											 echo "<option value='0' selected='selected'> Select</option>";

											}

											else{

												$hop=$row['ed02_3'];

												$sql1="SELECT value from retreive_data WHERE qus='ed01' and hoption='$hop' ";

												$result1= mysql_query($sql1) or die ("problem 2ND BLOCK OF RESPONDENT");

												$value = mysql_fetch_assoc($result1);

												$mv= $value['value'];

												echo "<option value='$hop' selected='selected'> $hop-$mv</option>";

											}

										?>

									<option value="1">1-Easily</option>

									<option value="2">2-With difficulty</option>

									<option value="3">3-Unable</option>

								</select>					

							</td>

					</tr>	

					<tr align="left">

							<td align="left" valign="top">ED03: Ever attended school or still going to school?</td>

					</tr>

					<tr align="left">

							<td align="left" <?php if($row['ed03'] == ''||$row['ed03'] == '0'){?>bgcolor="#F7A244"<?php }?>>

								<select name="ed03">

									 <?php

											if($row['ed03'] == ''||$row['ed03'] == '0'){

											 echo "<option value='0' selected='selected'> Select</option>";

											}

											else{

												$hop=$row['ed03'];

												$sql1="SELECT value from retreive_data WHERE qus='spn01_a' and hoption='$hop' ";

												$result1= mysql_query($sql1) or die ("problem 2ND BLOCK OF RESPONDENT");

												$value = mysql_fetch_assoc($result1);

												$mv= $value['value'];

												echo "<option value='$hop' selected='selected'> $hop-$mv</option>";

											}

										?>

									<option value="1">1-Yes</option>

									<option value="3">3-No</option>

								</select>					

							</td>

					</tr>				

					<tr>

							<td  align="right">

								<input type="submit" value="Next" class="input-box" />&nbsp;

							</td>

					</tr>	

				</table>

		</form>

	<?php } ?>

	<?php if ($serial=='ed02'){ 

				$sql="SELECT ed04 FROM education WHERE hid = '$hid' and resp_id = '$respondent'";

				$result = mysql_query($sql) or die ("problem budget_heads");

				$row = mysql_fetch_assoc($result);

		?>

				<form action="answer.php?qus=ed02" method="post">

				<table align="center" class="table_border" >

					<tr align="left">

							<td align="left" valign="top"> Education:</td>

					</tr>

					<tr align="left">

							<td align="left" valign="top">ED04: Why have you never attended school?</td>

					</tr>

					<tr align="left">

							<td align="left" <?php if($row['ed04'] == ''||$row['ed04'] == '0'){?>bgcolor="#F7A244"<?php }?>>

								<select name="ed04">

									 <?php

											if($row['ed04'] == ''||$row['ed04'] == '0'){

											 echo "<option value='0' selected='selected'> Select</option>";

											}

											else{

												$hop=$row['ed04'];

												$sql1="SELECT value from retreive_data WHERE qus='ed04' and hoption='$hop' ";

												$result1= mysql_query($sql1) or die ("problem 2ND BLOCK OF RESPONDENT");

												$value = mysql_fetch_assoc($result1);

												$mv= $value['value'];

												echo "<option value='$hop' selected='selected'> $hop-$mv</option>";

											}

										?>

										<?php for($i=1;$i<=16;$i++){

											$hop=$i;

											$sql1="SELECT value from retreive_data WHERE qus='ed04' and hoption='$hop' ";

											$result1= mysql_query($sql1) or die ("problem 2ND BLOCK OF RESPONDENT");

											$value = mysql_fetch_assoc($result1);

											$mv= $value['value'];

											echo "<option value='$hop'> $hop-$mv</option>";

									} ?>

									

								</select>					

							</td>

					</tr>

					<tr>

							<td  align="right">

								<input type="submit" value="Next" class="input-box" />&nbsp;

							</td>

					</tr>	

				</table>

		</form>

	<?php } ?>

	<?php if ($serial=='ed03'){ 

				$sql="SELECT ed05, ed06 FROM education WHERE hid = '$hid' and resp_id = '$respondent'";

				$result = mysql_query($sql) or die ("problem budget_heads");

				$row = mysql_fetch_assoc($result);

		?>

				<form action="answer.php?qus=ed03" method="post">

				<table align="center" class="table_border" >

					<tr align="left">

							<td align="left" valign="top"> Education:</td>

					</tr>

					<tr align="left">

							<td align="left" valign="top">ED05: Age when you first attended school?</td>

					</tr>

					<tr align="left">

							<td align="left" <?php if($row['ed05'] == ''||$row['ed05'] == '00'){?>bgcolor="#F7A244"<?php }?>>

								<select name="d1">

									 <?php for($i=0;$i<=9;$i++){?>

									 <option value="<?php echo $i;?>"><?php echo $i;?></option>

									 <?php }?>

								</select>	

								<select name="d2">

									 <?php for($i=0;$i<=9;$i++){?>

									 <option value="<?php echo $i;?>"><?php echo $i;?></option>

									 <?php }?>

								</select> &nbsp;&nbsp;yrs						

							</td>

					</tr>

					<tr align="left">

							<td align="left" valign="top">ED06: Last attended schlType?</td>

					</tr>

					<tr align="left">

							<td align="left" <?php if($row['ed06'] == ''||$row['ed06'] == '0'){?>bgcolor="#F7A244"<?php }?>>

								<select name="ed06">

									 <?php

											if($row['ed06'] == ''||$row['ed06'] == '0'){

											 echo "<option value='0' selected='selected'> Select</option>";

											}

											else{

												$hop=$row['ed06'];

												$sql1="SELECT value from retreive_data WHERE qus='ed06' and hoption='$hop' ";

												$result1= mysql_query($sql1) or die ("problem 2ND BLOCK OF RESPONDENT");

												$value = mysql_fetch_assoc($result1);

												$mv= $value['value'];

												echo "<option value='$hop' selected='selected'> $hop-$mv</option>";

											}

										?>

										<?php for($i=2;$i<=5;$i++){

											$hop=$i;

											$sql1="SELECT value from retreive_data WHERE qus='ed06' and hoption='$hop' ";

											$result1= mysql_query($sql1) or die ("problem 2ND BLOCK OF RESPONDENT");

											$value = mysql_fetch_assoc($result1);

											$mv= $value['value'];

											echo "<option value='$hop'> $hop-$mv</option>";

									} ?>

									

								</select>					

							</td>

					</tr>

					<tr>

							<td  align="right">

								<input type="submit" value="Next" class="input-box" />&nbsp;

							</td>

					</tr>	

				</table>

		</form>

	<?php } ?>

	<?php if ($serial=='ed04'){ 

				$sql="SELECT ed06, ed07, ed08 FROM education WHERE hid = '$hid' and resp_id = '$respondent'";

				$result = mysql_query($sql) or die ("problem budget_heads");

				$row = mysql_fetch_assoc($result);

		?>

				<form action="answer.php?qus=ed04" method="post">

				<table align="center" class="table_border" >

					<tr align="left">

							<td align="left" valign="top"> Education:</td>

					</tr>

					<tr align="left" <?php if($row['ed06']=='2'){?> style="display:none"<?php }?>>

							<td align="left" valign="top">ED07: Class completed?</td>

					</tr>

					<tr align="left" <?php if($row['ed06']=='2'){?> style="display:none"<?php }?>>

							<td align="left" <?php if($row['ed07'] == ''||$row['ed07'] == '00'){?>bgcolor="#F7A244"<?php }?>>

								<select name="d1">

									 <?php for($i=0;$i<=3;$i++){?>

									 <option value="<?php echo $i;?>"><?php echo $i;?></option>

									 <?php }?>

								</select>	

								<select name="d2">

									 <?php for($i=0;$i<=9;$i++){?>

									 <option value="<?php echo $i;?>"><?php echo $i;?></option>

									 <?php }?>

								</select> &nbsp;&nbsp;						

							</td>

					</tr>

					<tr align="left">

							<td align="left" valign="top">ED08: Currently going to school?</td>

					</tr>

					<tr align="left">

							<td align="left" <?php if($row['ed08'] == ''||$row['ed08'] == '0'){?>bgcolor="#F7A244"<?php }?>>

								<select name="ed08">

									 <?php

											if($row['ed08'] == ''||$row['ed08'] == '0'){

											 echo "<option value='0' selected='selected'> Select</option>";

											}

											else{

												$hop=$row['ed08'];

												$sql1="SELECT value from retreive_data WHERE qus='spn01_a' and hoption='$hop' ";

												$result1= mysql_query($sql1) or die ("problem 2ND BLOCK OF RESPONDENT");

												$value = mysql_fetch_assoc($result1);

												$mv= $value['value'];

												echo "<option value='$hop' selected='selected'> $hop-$mv</option>";

											}

										?>

										<option value="1">1-Yes</option>

										<option value="3">3-No</option>									

								</select>					

							</td>

					</tr>

					<tr>

							<td  align="right">

								<input type="submit" value="Next" class="input-box" />&nbsp;

							</td>

					</tr>	

				</table>

		</form>

	<?php } ?>

	<?php if ($serial=='ed05'){ 

				$sql="SELECT ed09, ed10 FROM education WHERE hid = '$hid' and resp_id = '$respondent'";

				$result = mysql_query($sql) or die ("problem budget_heads");

				$row = mysql_fetch_assoc($result);

		?>

				<form action="answer.php?qus=ed05" method="post">

				<table align="center" class="table_border" >

					<tr align="left">

							<td align="left" valign="top"> Education:</td>

					</tr>

					<tr align="left">

							<td align="left" valign="top">ED09: Age when finished studying?</td>

					</tr>

					<tr align="left">

							<td align="left" <?php if($row['ed09'] == ''||$row['ed09'] == '00'){?>bgcolor="#F7A244"<?php }?>>

								<select name="d1">

									 <?php for($i=0;$i<=9;$i++){?>

									 <option value="<?php echo $i;?>"><?php echo $i;?></option>

									 <?php }?>

								</select>	

								<select name="d2">

									 <?php for($i=0;$i<=9;$i++){?>

									 <option value="<?php echo $i;?>"><?php echo $i;?></option>

									 <?php }?>

								</select> &nbsp;&nbsp;yrs						

							</td>

					</tr>

					<tr align="left">

							<td align="left" valign="top">ED10: Why didn’t you study further?</td>

					</tr>

					<tr align="left">

							<td align="left" <?php if($row['ed10'] == ''||$row['ed10'] == '0'){?>bgcolor="#F7A244"<?php }?>>

								<select name="ed10">

									 <?php

											if($row['ed10'] == ''||$row['ed10'] == '0'){

											 echo "<option value='0' selected='selected'> Select</option>";

											}

											else{

												$hop=$row['ed10'];

												$sql1="SELECT value from retreive_data WHERE qus='ed04' and hoption='$hop' ";

												$result1= mysql_query($sql1) or die ("problem 2ND BLOCK OF RESPONDENT");

												$value = mysql_fetch_assoc($result1);

												$mv= $value['value'];

												echo "<option value='$hop' selected='selected'> $hop-$mv</option>";

											}

										?>

										<?php for($i=1;$i<=16;$i++){

											$hop=$i;

											$sql1="SELECT value from retreive_data WHERE qus='ed04' and hoption='$hop' ";

											$result1= mysql_query($sql1) or die ("problem 2ND BLOCK OF RESPONDENT");

											$value = mysql_fetch_assoc($result1);

											$mv= $value['value'];

											echo "<option value='$hop'> $hop-$mv</option>";

									} ?>

									

								</select>					

							</td>

					</tr>

					<tr>

							<td  align="right">

								<input type="submit" value="Next" class="input-box" />&nbsp;

							</td>

					</tr>	

				</table>

		</form>

	<?php } ?>

	

	

	

	<?php if ($serial=='emp01'){ 

				$sql="SELECT emp01 FROM adult_question WHERE hid = '$hid' and resp_id = '$respondent'";

				$result = mysql_query($sql) or die ("problem budget_heads");

				$row = mysql_fetch_assoc($result);

		?>

				<form action="answer.php?qus=emp01" method="post">

				<table align="center" class="table_border" >

					<tr align="left">

							<td align="left" valign="top"> Employment:</td>

					</tr>

					<tr align="left">

							<td align="left" valign="top">EMP01: Did you work last month:</td>

					</tr>

					<tr align="left">

							<td align="left" <?php if($row['emp01'] == ''||$row['emp01'] == '0'){?>bgcolor="#F7A244"<?php }?>>

								<select name="emp01">

									 <?php

											if($row['emp01'] == ''||$row['emp01'] == '0'){

											 echo "<option value='0' selected='selected'> Select</option>";

											}

											else{

												$hop=$row['emp01'];

												$sql1="SELECT value from retreive_data WHERE qus='emp01' and hoption='$hop' ";

												$result1= mysql_query($sql1) or die ("problem 2ND BLOCK OF RESPONDENT");

												$value = mysql_fetch_assoc($result1);

												$mv= $value['value'];

												echo "<option value='$hop' selected='selected'> $hop-$mv</option>";

											}

										?>

									<option value="1">1-Yes</option>

									<option value="2">2-No</option>

								</select>					

							</td>

					</tr>

					<tr>

							<td  align="right">

								<input type="submit" value="Next" class="input-box" />&nbsp;

							</td>

					</tr>	

				</table>

		</form>

	<?php } ?>

	<?php if ($serial=='emp'){ 

			 	$sql="SELECT emp01, emp02, emp03, emp04_a, emp04_b, emp05, emp06, emp06, emp07 FROM adult_question WHERE hid = '$hid' and resp_id = '$respondent'";

				$result = mysql_query($sql) or die ("problem budget_heads");

				$row = mysql_fetch_assoc($result);

		?>

				<form action="answer.php?qus=emp" method="post">

				<table align="center" class="table_border" >

					<tr align="left">

							<td align="left" valign="top"> Employment:</td>

					</tr>

					<tr align="left" <?php if($row['emp01']==1){?> style="display:none"<?php }?>>

							<td align="left" valign="top">EMP02: Why didn't you work :</td>

					</tr>

					<tr align="left" <?php if($row['emp01']==1){?> style="display:none"<?php }?>>

							<td align="left" <?php if($row['emp02'] == ''||$row['emp02'] == '00'){?>bgcolor="#F7A244"<?php }?>>

								<select name="emp02">

									 <?php

											if($row['emp02'] == ''||$row['emp02'] == '00'){

											 echo "<option value='00' selected='selected'> Select</option>";

											}

											else{

												$hop=$row['emp02'];

												$sql1="SELECT value from retreive_data WHERE qus='emp02' and hoption='$hop' ";

												$result1= mysql_query($sql1) or die ("problem 2ND BLOCK OF RESPONDENT");

												$value = mysql_fetch_assoc($result1);

												$mv= $value['value'];

												echo "<option value='$hop' selected='selected'> $hop-$mv</option>";

											}

										?>

									<option value="01"> 01-Retired </option>

									<option value="02"> 02-Sick </option>

									<option value="03"> 03-Become Paralysed </option>

									<option value="04"> 04-For Marrying </option>

									<option value="05"> 05-Become older</option>

									<option value="06"> 06-For child birth</option>

									<option value="07"> 07-Other's</option>

								</select>					

							</td>

					</tr>

					<tr align="left">

							<td align="left" valign="top">EMP03:What was your last occuptn :</td>

					</tr>

					<tr align="left">

							<td align="left" <?php if($row['emp03'] == ''){?>bgcolor="#F7A244"<?php }?>>

								<input type="text" name="emp03" /> 				

							</td>

					</tr>

					<tr align="left">

							<td align="left" valign="top">EMP04a:Main Profssn(prsnt) :</td>

					</tr>

					<tr align="left">

							<td align="left" <?php if($row['emp04_a'] == ''){?>bgcolor="#F7A244"<?php }?>>

								<input type="text" name="emp04_a" />	 				

							</td>

					</tr>

					<tr align="left">

							<td align="left" valign="top">EMP04b: Alt Profssn(if any) :</td>

					</tr>

					<tr align="left">

							<td align="left" <?php if($row['emp04_b'] == ''){?>bgcolor="#F7A244"<?php }?>>

								 <input type="text" name="emp04_b" />					

							</td>

					</tr>

					<tr align="left">

							<td align="left" valign="top">EMP05: Main income generator:</td>

					</tr>

					<tr align="left">

							<td align="left" <?php if($row['emp05'] == ''||$row['emp05'] == '00'){?>bgcolor="#F7A244"<?php }?>>

									<input type="text" name="emp05" />				

							</td>

					</tr>

					<tr align="left">

							<td align="left" valign="top">EMP06:Longest Profssn :</td>

					</tr>

					<tr align="left" >

							<td align="left" <?php if($row['emp06'] == ''||$row['emp06'] == '00'){?>bgcolor="#F7A244"<?php }?>>

									 <input type="text" name="emp06" />				

							</td>

					</tr>

					<tr align="left">

							<td align="left" valign="top">EMP07:Avg Monthly Earning :</td>

					</tr>

					<tr align="left">

							<td align="left" <?php if($row['emp07'] == ''){?>bgcolor="#F7A244"<?php }?>>

									<input type="text" name="income" value="<?php echo $row['emp07'] ;?>" /> TK.				

							</td>

					</tr>

					<tr>

							<td  align="right">

								<input type="submit" value="Next" class="input-box" />&nbsp;

							</td>

					</tr>	

				</table>

		</form>

		<?php } ?>

		<?php if ($serial=='mh01'){ 

				$sql="SELECT mh01 FROM marital1 WHERE hid = '$hid' and resp_id = '$respondent'";

				$result = mysql_query($sql) or die ("problem budget_heads");

				$row = mysql_fetch_assoc($result);

		?>

				<form action="answer.php?qus=mh01" method="post">

				<table align="center" class="table_border" >

					<tr align="left">

							<td align="left" valign="top"> Marital History:</td>

					</tr>

					<tr align="left">

							<td align="left" valign="top">MH01: Current Marital Status?</td>

					</tr>

					<tr align="left">

							<td align="left" <?php if($row['mh01'] == ''||$row['mh01'] == '0'){?>bgcolor="#F7A244"<?php }?>>

								<select name="mh01">

									 <?php

											if($row['mh01'] == ''||$row['mh01'] == '0'){

											 echo "<option value='0' selected='selected'> Select</option>";

											}

											else{

												$hop=$row['mh01'];

												$sql1="SELECT value from retreive_data WHERE qus='mh01' and hoption='$hop' ";

												$result1= mysql_query($sql1) or die ("problem 2ND BLOCK OF RESPONDENT");

												$value = mysql_fetch_assoc($result1);

												$mv= $value['value'];

												echo "<option value='$hop' selected='selected'> $hop-$mv</option>";

											}

										?>

										<?php for($i=1;$i<=5;$i++){

											$hop=$i;

											$sql1="SELECT value from retreive_data WHERE qus='mh01' and hoption='$hop' ";

											$result1= mysql_query($sql1) or die ("problem 2ND BLOCK OF RESPONDENT");

											$value = mysql_fetch_assoc($result1);

											$mv= $value['value'];

											echo "<option value='$hop'> $hop-$mv</option>";

									} ?>

									

								</select>					

							</td>

					</tr>

					<tr>

							<td  align="right">

								<input type="submit" value="Next" class="input-box" />&nbsp;

							</td>

					</tr>	

				</table>

			</form>

		<?php } ?>

		<?php if ($serial=='mh02'){ 

				$sql="SELECT mh02, mh03 FROM marital1 WHERE hid = '$hid' and resp_id = '$respondent'";

				$result = mysql_query($sql) or die ("problem budget_heads");

				$row = mysql_fetch_assoc($result);

		?>

				<form action="answer.php?qus=mh02" method="post">

				<table align="center" class="table_border" >

					<tr align="left">

							<td align="left" valign="top"> Marital History:</td>

					</tr>

					<tr align="left">

							<td align="left" valign="top">MH02: How many times you have been married?</td>

					</tr>

					<tr align="left">

							<td align="left" <?php if($row['mh02'] == ''||$row['mh02'] == '00'){?>bgcolor="#F7A244"<?php }?>>

								<select name="d1">

									 <?php for($i=0;$i<=9;$i++){?>

									 <option value="<?php echo $i;?>"><?php echo $i;?></option>

									 <?php }?>

								</select>	

								<select name="d2">

									 <?php for($i=0;$i<=9;$i++){?>

									 <option value="<?php echo $i;?>"><?php echo $i;?></option>

									 <?php }?>

								</select> &nbsp;&nbsp;Times						

							</td>

					</tr>

					<tr align="left">

							<td align="left" valign="top">MH03: Do you have more than 1 wife at present (For males)?</td>

					</tr>

					<tr align="left">

							<td align="left" <?php if($row['mh03'] == ''||$row['mh03'] == '0'){?>bgcolor="#F7A244"<?php }?>>

								<select name="mh03">

									 <?php

											if($row['mh03'] == ''||$row['mh03'] == '0'){

											 echo "<option value='0' selected='selected'> Select</option>";

											}

											else{

												$hop=$row['mh03'];

												$sql1="SELECT value from retreive_data WHERE qus='cm13' and hoption='$hop' ";

												$result1= mysql_query($sql1) or die ("problem 2ND BLOCK OF RESPONDENT");

												$value = mysql_fetch_assoc($result1);

												$mv= $value['value'];

												echo "<option value='$hop' selected='selected'> $hop-$mv</option>";

											}

										?>

										<option value="1">1-Yes</option>

										<option value="3">3-No</option>

									<!--	<option value="8">8-NA</option>	!-->									

								</select>					

							</td>

					</tr>

					<tr>

							<td  align="right">

								<input type="submit" value="Next" class="input-box" />&nbsp;

							</td>

					</tr>	

				</table>

			</form>

		<?php } ?>

		<?php if ($serial=='mh03'){ 

				$no=$_GET['no'];

				if($no=='')$no=1;

				$sql="SELECT mh04, mh05a, mh05b, mh05b, mh06 FROM marital2 WHERE hid = '$hid' and resp_id = '$respondent'";

				$result = mysql_query($sql) or die ("problem budget_heads");

				$row = mysql_fetch_assoc($result);

		?>

				<form action="answer.php?qus=mh03" method="post">

				<input type="hidden" name="no" value="<?php echo $no;?>" />

				<table align="center" class="table_border" >

					<tr align="left">

							<td align="left" valign="top"> Marital History:</td>

					</tr>

					<tr align="left">

							<td align="left" valign="top"> Marriage No. <?php echo $no;?></td>

					</tr>

					<tr align="left">

							<td align="left" valign="top">MH04: Spouse name?</td>

					</tr>

					<tr align="left">

							<td align="left" <?php if($row['mh04'] == ''){?>bgcolor="#F7A244"<?php }?>>

								<input type="text" name="mh04" />						

							</td>

					</tr>

					<tr align="left">

							<td align="left" valign="top">MH05a: Age when you got married??</td>

					</tr>

					<tr align="left">

							<td align="left" <?php if($row['mh05a'] == ''||$row['mh05a'] == '00'){?>bgcolor="#F7A244"<?php }?>>

								<select name="d1">

									 <?php for($i=0;$i<=9;$i++){?>

									 <option value="<?php echo $i;?>"><?php echo $i;?></option>

									 <?php }?>

								</select>	

								<select name="d2">

									 <?php for($i=0;$i<=9;$i++){?>

									 <option value="<?php echo $i;?>"><?php echo $i;?></option>

									 <?php }?>

								</select> &nbsp;&nbsp;yrs						

							</td>

					</tr>

					<tr align="left">

							<td align="left" valign="top">MH05b: Spouse age when you got married??</td>

					</tr>

					<tr align="left">

							<td align="left" <?php if($row['mh05b'] == ''||$row['mh05b'] == '00'){?>bgcolor="#F7A244"<?php }?>>

								<select name="d3">

									 <?php for($i=0;$i<=9;$i++){?>

									 <option value="<?php echo $i;?>"><?php echo $i;?></option>

									 <?php }?>

								</select>	

								<select name="d4">

									 <?php for($i=0;$i<=9;$i++){?>

									 <option value="<?php echo $i;?>"><?php echo $i;?></option>

									 <?php }?>

								</select> &nbsp;&nbsp;yrs						

							</td>

					</tr>

					<tr align="left">

							<td align="left" valign="top">MH06: What was given as dowry?</td>

					</tr>

					<tr align="left">

							<td align="left" <?php if($row['mh06'] == ''||$row['mh06'] == '0'){?>bgcolor="#F7A244"<?php }?>>

								<select name="mh06">

									 <?php

											if($row['mh06'] == ''||$row['mh06'] == '0'){

											 echo "<option value='0' selected='selected'> Select</option>";

											}

											else{

												$hop=$row['mh06'];

												$sql1="SELECT value from retreive_data WHERE qus='mh06' and hoption='$hop' ";

												$result1= mysql_query($sql1) or die ("problem 2ND BLOCK OF RESPONDENT");

												$value = mysql_fetch_assoc($result1);

												$mv= $value['value'];

												echo "<option value='$hop' selected='selected'> $mv</option>";

											}

										?>

										<?php for($i=1;$i<=9;$i++){

											$hop=$i;

											$sql1="SELECT value from retreive_data WHERE qus='mh06' and hoption='$hop' ";

											$result1= mysql_query($sql1) or die ("problem 2ND BLOCK OF RESPONDENT");

											$value = mysql_fetch_assoc($result1);

											$mv= $value['value'];

											echo "<option value='$hop'> $mv</option>";

									} ?>								

								</select>					

							</td>

					</tr>

					<tr>

							<td  align="right">

								<input type="submit" value="Next" class="input-box" />&nbsp;

							</td>

					</tr>	

				</table>

			</form>

		<?php } ?>

		<?php if ($serial=='mh04'){

				$id=$_GET['id']; 

				$no=$_GET['no'];

				$sql="SELECT mh07 FROM marital2 WHERE id=$id";

				$result = mysql_query($sql) or die ("problem budget_heads");

				$row = mysql_fetch_assoc($result);

		?>

				<form action="answer.php?qus=mh04" method="post">

				<input type="hidden" name="no" value="<?php echo $no;?>" />

				<input type="hidden" name="id" value="<?php echo $id;?>" />

				<table align="center" class="table_border" >

					<tr align="left">

							<td align="left" valign="top"> Marital History:</td>

					</tr>

					<tr align="left">

							<td align="left" valign="top"> Marriage No. <?php echo $no;?></td>

					</tr>

					<tr align="left">

							<td align="left" valign="top">MH07: Monetary value of the items received in dowry?</td>

					</tr>

					<tr align="left">

							<td align="left" <?php if($row['mh07'] == ''){?>bgcolor="#F7A244"<?php }?>>

								<input type="text" name="mh07" />tk.					

							</td>

					</tr>

					<tr>

							<td  align="right">

								<input type="submit" value="Next" class="input-box" />&nbsp;

							</td>

					</tr>	

				</table>

			</form>

		<?php } ?>

		<?php if ($serial=='mh05'){

				$id=$_GET['id']; 

				$no=$_GET['no'];

				$sql="SELECT mh08 FROM marital2 WHERE id=$id";

				$result = mysql_query($sql) or die ("problem budget_heads");

				$row = mysql_fetch_assoc($result);

		?>

				<form action="answer.php?qus=mh05" method="post">

				<input type="hidden" name="no" value="<?php echo $no;?>" />

				<input type="hidden" name="id" value="<?php echo $id;?>" />

				<table align="center" class="table_border" >

					<tr align="left">

							<td align="left" valign="top">MH08: Current marital status?</td>

					</tr>

					<tr align="left">

							<td align="left" <?php if($row['mh08'] == ''||$row['mh08'] == '0'){?>bgcolor="#F7A244"<?php }?>>

								<select name="mh08">

									 <?php

											if($row['mh08'] == ''||$row['mh08'] == '0'){

											 echo "<option value='0' selected='selected'> Select</option>";

											}

											else{

												$hop=$row['mh08'];

												$sql1="SELECT value from retreive_data WHERE qus='mh08' and hoption='$hop' ";

												$result1= mysql_query($sql1) or die ("problem 2ND BLOCK OF RESPONDENT");

												$value = mysql_fetch_assoc($result1);

												$mv= $value['value'];

												echo "<option value='$hop' selected='selected'>$hop-$mv</option>";

											}

										?>

										<?php for($i=1;$i<=3;$i++){

											$hop=$i;

											$sql1="SELECT value from retreive_data WHERE qus='mh08' and hoption='$hop' ";

											$result1= mysql_query($sql1) or die ("problem 2ND BLOCK OF RESPONDENT");

											$value = mysql_fetch_assoc($result1);

											$mv= $value['value'];

											echo "<option value='$hop'>$hop-$mv</option>";

									} ?>								

								</select>					

							</td>

					</tr>

					<tr>

							<td  align="right">

								<input type="submit" value="Next" class="input-box" />&nbsp;

							</td>

					</tr>	

				</table>

			</form>

		<?php } ?>

		<?php if ($serial=='mh06'){

				$id=$_GET['id']; 

				$no=$_GET['no'];

				$sql="SELECT mh09 FROM marital2 WHERE id=$id";

				$result = mysql_query($sql) or die ("problem budget_heads");

				$row = mysql_fetch_assoc($result);

		?>

				<form action="answer.php?qus=mh06" method="post">

				<input type="hidden" name="no" value="<?php echo $no;?>" />

				<input type="hidden" name="id" value="<?php echo $id;?>" />

				<table align="center" class="table_border" >

					<tr align="left">

							<td align="left" valign="top">MH09: Reason for divorce?</td>

					</tr>

					<tr align="left">

							<td align="left" <?php if($row['mh09'] == ''||$row['mh09'] == '0'){?>bgcolor="#F7A244"<?php }?>>

								<select name="mh09">

									 <?php

											if($row['mh09'] == ''||$row['mh09'] == '0'){

											 echo "<option value='0' selected='selected'> Select</option>";

											}

											else{

												$hop=$row['mh09'];

												$sql1="SELECT value from retreive_data WHERE qus='mh09' and hoption='$hop' ";

												$result1= mysql_query($sql1) or die ("problem 2ND BLOCK OF RESPONDENT");

												$value = mysql_fetch_assoc($result1);

												$mv= $value['value'];

												echo "<option value='$hop' selected='selected'>$mv</option>";

											}

										?>

										<?php for($i=1;$i<=8;$i++){

											$hop=$i;

											$sql1="SELECT value from retreive_data WHERE qus='mh09' and hoption='$hop' ";

											$result1= mysql_query($sql1) or die ("problem 2ND BLOCK OF RESPONDENT");

											$value = mysql_fetch_assoc($result1);

											$mv= $value['value'];

											echo "<option value='$hop'>$mv</option>";

									} ?>								

								</select>					

							</td>

					</tr>

					<tr>

							<td  align="right">

								<input type="submit" value="Next" class="input-box" />&nbsp;

							</td>

					</tr>	

				</table>

			</form>

		<?php } ?>

		<?php if ($serial=='mh07'){

				$id=$_GET['id']; 

				$no=$_GET['no'];

				$sql="SELECT mh10 FROM marital2 WHERE id=$id";

				$result = mysql_query($sql) or die ("problem budget_heads");

				$row = mysql_fetch_assoc($result);

		?>

				<form action="answer.php?qus=mh07" method="post">

				<input type="hidden" name="no" value="<?php echo $no;?>" />

				<input type="hidden" name="id" value="<?php echo $id;?>" />

				<table align="center" class="table_border" >

					<tr align="left">

							<td align="left" valign="top">MH10: Age when widowed/ separated/ divorced?</td>

					</tr>

					<tr align="left">

							<td align="left" <?php if($row['mh10'] == ''||$row['mh09'] == '00'){?>bgcolor="#F7A244"<?php }?>>

								<select name="d1">

									 <?php for($i=0;$i<=9;$i++){?>

									 <option value="<?php echo $i;?>"><?php echo $i;?></option>

									 <?php }?>

								</select>	

								<select name="d2">

									 <?php for($i=0;$i<=9;$i++){?>

									 <option value="<?php echo $i;?>"><?php echo $i;?></option>

									 <?php }?>

								</select> &nbsp;&nbsp;yrs						

							</td>

					</tr>

					<tr>

							<td  align="right">

								<input type="submit" value="Next" class="input-box" />&nbsp;

							</td>

					</tr>	

				</table>

			</form>

		<?php } ?>

		<?php if ($serial=='mh08'){

				$id=$_GET['id']; 

				$no=$_GET['no'];

				$sql="SELECT mh11 FROM marital2 WHERE id=$id";

				$result = mysql_query($sql) or die ("problem budget_heads");

				$row = mysql_fetch_assoc($result);

		?>

				<form action="answer.php?qus=mh08" method="post">

				<input type="hidden" name="no" value="<?php echo $no;?>" />

				<input type="hidden" name="id" value="<?php echo $id;?>" />

				<table align="center" class="table_border" >

					<tr align="left">

							<td align="left" valign="top">MH11: Spouse's yrs of schlng?</td>

					</tr>

					<tr align="left">

							<td align="left" <?php if($row['mh11'] == ''||$row['mh09'] == '00'){?>bgcolor="#F7A244"<?php }?>>

								<select name="d1">

									 <?php for($i=0;$i<=9;$i++){?>

									 <option value="<?php echo $i;?>"><?php echo $i;?></option>

									 <?php }?>

								</select>	

								<select name="d2">

									 <?php for($i=0;$i<=9;$i++){?>

									 <option value="<?php echo $i;?>"><?php echo $i;?></option>

									 <?php }?>

								</select> 					

							</td>

					</tr>

					<tr>

							<td  align="right">

								<input type="submit" value="Next" class="input-box" />&nbsp;

							</td>

					</tr>	

				</table>

			</form>

		<?php } ?>

		<?php if ($serial=='spn01'){ 

				$sql="SELECT spn01_a, spn01_b, spn01_c, spn01_d, spn01_e FROM adult_question WHERE hid = '$hid' and resp_id = '$respondent'";

				$result = mysql_query($sql) or die ("problem budget_heads");

				$row = mysql_fetch_assoc($result);

		?>

				<form action="answer.php?qus=spn_01" method="post">

				<table align="center" class="table_border" >

					<tr align="left">

							<td align="left" valign="top"> Ever Use:</td>

					</tr>

					<tr align="left">

							<td align="left" valign="top">SPN01A: Chewing Pan :</td>

					</tr>

					<tr align="left">

							<td align="left" <?php if($row['spn01_a'] == ''||$row['spn01_a'] == '0'){?>bgcolor="#F7A244"<?php }?>>

								<select name="spn01_a">

									 <?php

											if($row['spn01_a'] == ''||$row['spn01_a'] == '0'){

											 echo "<option value='0'> Select</option>";

											}

											else{

												$hop=$row['spn01_a'];

												$sql1="SELECT value from retreive_data WHERE qus='spn01_a' and hoption='$hop' ";

												$result1= mysql_query($sql1) or die ("problem 2ND BLOCK OF RESPONDENT");

												$value = mysql_fetch_assoc($result1);

												$mv= $value['value'];

												echo "<option value='$hop' selected='selected'> $hop-$mv</option>";

											}

										?>

									<option value="1">1-Yes</option>

									<option value="3" selected="selected">3-No</option>

								</select>					

							</td>

					</tr>

					<tr align="left">

							<td align="left" valign="top">SPN01B: Smoking(Hukka) :</td>

					</tr>

					<tr align="left">

							<td align="left" <?php if($row['spn01_b'] == ''||$row['spn01_b'] == '0'){?>bgcolor="#F7A244"<?php }?>>

								<select name="spn01_b">

									 <?php

											if($row['spn01_b'] == ''||$row['spn01_b'] == '0'){

											 echo "<option value='0'> Select</option>";

											}

											else{

												$hop=$row['spn01_b'];

												$sql1="SELECT value from retreive_data WHERE qus='spn01_b' and hoption='$hop' ";

												$result1= mysql_query($sql1) or die ("problem 2ND BLOCK OF RESPONDENT");

												$value = mysql_fetch_assoc($result1);

												$mv= $value['value'];

												echo "<option value='$hop' selected='selected'> $hop-$mv</option>";

											}

										?>

									<option value="1">1-Yes</option>

									<option value="3" selected="selected">3-No</option>

								</select>					

							</td>

					</tr>

					<tr align="left">

							<td align="left" valign="top">SPN01C: Smoking(Biri):</td>

					</tr>

					<tr align="left">

							<td align="left" <?php if($row['spn01_c'] == ''||$row['spn01_c'] == '0'){?>bgcolor="#F7A244"<?php }?>>

								<select name="spn01_c">

									 <?php

											if($row['spn01_c'] == ''||$row['spn01_c'] == '0'){

											 echo "<option value='0'> Select</option>";

											}

											else{

												$hop=$row['spn01_c'];

												$sql1="SELECT value from retreive_data WHERE qus='spn01_c' and hoption='$hop' ";

												$result1= mysql_query($sql1) or die ("problem 2ND BLOCK OF RESPONDENT");

												$value = mysql_fetch_assoc($result1);

												$mv= $value['value'];

												echo "<option value='$hop' selected='selected'> $hop-$mv</option>";

											}

										?>

									<option value="1">1-Yes</option>

									<option value="3" selected="selected">3-No</option>

								</select>					

							</td>

					</tr>

					<tr align="left">

							<td align="left" valign="top">SPN01D:Smoking(Cigarette) :</td>

					</tr>

					<tr align="left">

							<td align="left" <?php if($row['spn01_d'] == ''||$row['spn01_d'] == '0'){?>bgcolor="#F7A244"<?php }?>>

								<select name="spn01_d">

									 <?php

											if($row['spn01_d'] == ''||$row['spn01_d'] == '0'){

											 echo "<option value='0'> Select</option>";

											}

											else{

												$hop=$row['spn01_d'];

												$sql1="SELECT value from retreive_data WHERE qus='spn01_d' and hoption='$hop' ";



												$result1= mysql_query($sql1) or die ("problem 2ND BLOCK OF RESPONDENT");

												$value = mysql_fetch_assoc($result1);

												$mv= $value['value'];

												echo "<option value='$hop' selected='selected'> $hop-$mv</option>";

											}

										?>

									<option value="1">1-Yes</option>

									<option value="3" selected="selected">3-No</option>

								</select>					

							</td>

					</tr>

					<tr align="left">

							<td align="left" valign="top">SPN01E: Gul:</td>

					</tr>

					<tr align="left">

							<td align="left" <?php if($row['spn01_e'] == ''||$row['spn01_e'] == '0'){?>bgcolor="#F7A244"<?php }?>>

								<select name="spn01_e">

									 <?php

											if($row['spn01_e'] == ''||$row['spn01_e'] == '0'){

											 echo "<option value='0'> Select</option>";

											}

											else{

												$hop=$row['spn01_e'];

												$sql1="SELECT value from retreive_data WHERE qus='spn01_e' and hoption='$hop' ";

												$result1= mysql_query($sql1) or die ("problem 2ND BLOCK OF RESPONDENT");

												$value = mysql_fetch_assoc($result1);

												$mv= $value['value'];

												echo "<option value='$hop' selected='selected'> $hop-$mv</option>";

											}

										?>

									<option value="1">1-Yes</option>

									<option value="3" selected="selected">3-No</option>

								</select>					

							</td>

					</tr>

					<tr>

							<td  align="right">

								<input type="submit" value="Next" class="input-box" />&nbsp;

							</td>

					</tr>	

				</table>

		</form>

		<?php } ?>

		<?php if ($serial=='spn02a'){

				$sql="SELECT spn02_a  FROM adult_question WHERE hid = '$hid' and resp_id = '$respondent'";

				$result = mysql_query($sql) or die ("problem budget_heads");

				$row = mysql_fetch_assoc($result);

		?>

				<form action="answer.php?qus=spn02a" method="post">

				<table align="center" class="table_border" >

					<tr align="left">

							<td align="left" valign="top">SPN02A: Currently Chewing Pan? :</td>

					</tr>

					<tr align="left">

							<td align="left" <?php if($row['spn02_a'] == ''||$row['spn02_a'] == '0'){?>bgcolor="#F7A244"<?php }?>>

								<select name="spn02_a">

									 <?php

											if($row['spn02_a'] == ''||$row['spn02_a'] == '0'){

											 echo "<option value='0' selected='selected'> Select</option>";

											}

											else{

												$hop=$row['spn02_a'];

												$sql1="SELECT value from retreive_data WHERE qus='spn02_a' and hoption='$hop' ";

												$result1= mysql_query($sql1) or die ("problem 2ND BLOCK OF RESPONDENT");

												$value = mysql_fetch_assoc($result1);

												$mv= $value['value'];

												echo "<option value='$hop' selected='selected'> $hop-$mv</option>";

											}

										?>	

									<option value="1">1-Yes</option>

									<option value="3">3-No</option>

								</select>					

							</td>

						</tr>

						<tr>

							<td  align="right">

								<input type="submit" value="Next" class="input-box" />&nbsp;

							</td>

					</tr>

					</table>

		<?php }?>

		<?php if ($serial=='spn02b'){

				$sql="SELECT spn02_b FROM adult_question WHERE hid = '$hid' and resp_id = '$respondent'";

				$result = mysql_query($sql) or die ("problem budget_heads");

				$row = mysql_fetch_assoc($result);

		?>

				<form action="answer.php?qus=spn02b" method="post">

				<table align="center" class="table_border" >

					<tr align="left">

							<td align="left" valign="top">SPN02B: Currently using Hukka:</td>

					</tr>

					<tr align="left">

							<td align="left" <?php if($row['spn02_b'] == ''||$row['spn02_b'] == '0'){?>bgcolor="#F7A244"<?php }?>>

								<select name="spn02_b">

									 <?php

											if($row['spn02_b'] == ''||$row['spn02_b'] == '0'){

											 echo "<option value='0' selected='selected'> Select</option>";

											}

											else{

												$hop=$row['spn02_b'];

												$sql1="SELECT value from retreive_data WHERE qus='spn02_b' and hoption='$hop' ";

												$result1= mysql_query($sql1) or die ("problem 2ND BLOCK OF RESPONDENT");

												$value = mysql_fetch_assoc($result1);

												$mv= $value['value'];

												echo "<option value='$hop' selected='selected'> $hop-$mv</option>";

											}

										?>	

									<option value="1">1-Yes</option>

									<option value="3">3-No</option>

								</select>					

							</td>

						</tr>

						<tr>

							<td  align="right">

								<input type="submit" value="Next" class="input-box" />&nbsp;

							</td>

					</tr>

					</table>

		<?php }?>

		<?php if ($serial=='spn02c'){

				$sql="SELECT spn02_c FROM adult_question WHERE hid = '$hid' and resp_id = '$respondent'";

				$result = mysql_query($sql) or die ("problem budget_heads");

				$row = mysql_fetch_assoc($result);

		?>

				<form action="answer.php?qus=spn02c" method="post">

				<table align="center" class="table_border" >

					<tr align="left">

							<td align="left" valign="top">SPN02C: Currently Smoking(Biri):</td>

					</tr>

					<tr align="left">

							<td align="left" <?php if($row['spn02_c'] == ''||$row['spn02_c'] == '0'){?>bgcolor="#F7A244"<?php }?>>

								<select name="spn02_c">

									 <?php

											if($row['spn02_c'] == ''||$row['spn02_c'] == '0'){

											 echo "<option value='0' selected='selected'> Select</option>";

											}

											else{

												$hop=$row['spn02_c'];

												$sql1="SELECT value from retreive_data WHERE qus='spn02_c' and hoption='$hop' ";

												$result1= mysql_query($sql1) or die ("problem 2ND BLOCK OF RESPONDENT");

												$value = mysql_fetch_assoc($result1);

												$mv= $value['value'];

												echo "<option value='$hop' selected='selected'> $hop-$mv</option>";

											}

										?>	

									<option value="1">1-Yes</option>

									<option value="3">3-No</option>

								</select>					

							</td>

						</tr>

						<tr>

							<td  align="right">

								<input type="submit" value="Next" class="input-box" />&nbsp;

							</td>

					</tr>

					</table>

		<?php }?>

		<?php if ($serial=='spn02d'){

				$sql="SELECT spn02_d FROM adult_question WHERE hid = '$hid' and resp_id = '$respondent'";

				$result = mysql_query($sql) or die ("problem budget_heads");

				$row = mysql_fetch_assoc($result);

		?>

				<form action="answer.php?qus=spn02d" method="post">

				<table align="center" class="table_border" >

					<tr align="left">

							<td align="left" valign="top">SPN02D:Currently Smoking(Cigarettes):</td>

					</tr>

					<tr align="left">

							<td align="left" <?php if($row['spn02_d'] == ''||$row['spn02_d'] == '0'){?>bgcolor="#F7A244"<?php }?>>

								<select name="spn02_d">

									 <?php

											if($row['spn02_d'] == ''||$row['spn02_d'] == '0'){

											 echo "<option value='0' selected='selected'> Select</option>";

											}

											else{

												$hop=$row['spn02_d'];

												$sql1="SELECT value from retreive_data WHERE qus='spn02_d' and hoption='$hop' ";

												$result1= mysql_query($sql1) or die ("problem 2ND BLOCK OF RESPONDENT");

												$value = mysql_fetch_assoc($result1);

												$mv= $value['value'];

												echo "<option value='$hop' selected='selected'> $hop-$mv</option>";

											}

										?>	

									<option value="1">1-Yes</option>

									<option value="3">3-No</option>

								</select>					

							</td>

						</tr>

						<tr>

							<td  align="right">

								<input type="submit" value="Next" class="input-box" />&nbsp;

							</td>

					</tr>

					</table>

		<?php }?>

		<?php if ($serial=='spn02e'){

				$sql="SELECT spn02_e FROM adult_question WHERE hid = '$hid' and resp_id = '$respondent'";

				$result = mysql_query($sql) or die ("problem budget_heads");

				$row = mysql_fetch_assoc($result);

		?>

				<form action="answer.php?qus=spn02e" method="post">

				<table align="center" class="table_border" >

					<tr align="left">

							<td align="left" valign="top">SPN02E: Currently using Gul:</td>

					</tr>

					<tr align="left">

							<td align="left" <?php if($row['spn02_e'] == ''||$row['spn02_e'] == '0'){?>bgcolor="#F7A244"<?php }?>>

								<select name="spn02_e">

									 <?php

											if($row['spn02_e'] == ''||$row['spn02_e'] == '0'){

											 echo "<option value='0' selected='selected'> Select</option>";

											}

											else{

												$hop=$row['spn02_e'];

												$sql1="SELECT value from retreive_data WHERE qus='spn02_e' and hoption='$hop' ";

												$result1= mysql_query($sql1) or die ("problem 2ND BLOCK OF RESPONDENT");

												$value = mysql_fetch_assoc($result1);

												$mv= $value['value'];

												echo "<option value='$hop' selected='selected'> $hop-$mv</option>";

											}

										?>	

									<option value="1">1-Yes</option>

									<option value="3">3-No</option>

								</select>					

							</td>

						</tr>

						<tr>

							<td  align="right">

								<input type="submit" value="Next" class="input-box" />&nbsp;

							</td>

					</tr>

					</table>

		<?php }?>

		<?php if ($serial=='spn02y'){

				$sql="SELECT spn04_a, spn05_a, spn06_a FROM adult_question WHERE hid = '$hid' and resp_id = '$respondent'";

				$result = mysql_query($sql) or die ("problem budget_heads");

				$row = mysql_fetch_assoc($result);

		?>

			<form action="answer.php?qus=spn02y" method="post">

				<table align="center" class="table_border" >

					<tr align="left">

							<td align="left" valign="top">Chewing Pan:</td>

					</tr>

					<tr align="left">

							<td align="left" valign="top">SPN04A: How often ?</td>

					</tr>

					<tr align="left">

							<td align="left" <?php if($row['spn04_a'] == ''||$row['spn04_a'] == '00'){?>bgcolor="#F7A244"<?php }?>>

									 <select name="t1">

										<option value="0">0</option>

										<option value="1">1</option>

										<option value="2">2</option>

										<option value="3">3</option>

										<option value="4">4</option>

										<option value="5">5</option>

										<option value="6">6</option>

										<option value="7">7</option>

										<option value="8">8</option>

										<option value="9">9</option>

									</select> 

									<select name="t2">

										<option value="0">0</option>

										<option value="1">1</option>

										<option value="2">2</option>

										<option value="3">3</option>

										<option value="4">4</option>

										<option value="5">5</option>

										<option value="6">6</option>

										<option value="7">7</option>

										<option value="8">8</option>

										<option value="9">9</option>

									</select>&nbsp;&nbsp;per day				

							</td>

					</tr>

					<tr align="left">

							<td align="left" valign="top">SPN05A: Starting Age :</td>

					</tr>

					<tr align="left">

							<td align="left" <?php if($row['spn05_a'] == ''||$row['spn05_a'] == '0'){?>bgcolor="#F7A244"<?php }?>>

								<select name="t3">

										<option value="0">0</option>

										<option value="1">1</option>

										<option value="2">2</option>

										<option value="3">3</option>

										<option value="4">4</option>

										<option value="5">5</option>

										<option value="6">6</option>

										<option value="7">7</option>

										<option value="8">8</option>

										<option value="9">9</option>

									</select> 

									<select name="t4">

										<option value="0">0</option>

										<option value="1">1</option>

										<option value="2">2</option>

										<option value="3">3</option>

										<option value="4">4</option>

										<option value="5">5</option>

										<option value="6">6</option>

										<option value="7">7</option>

										<option value="8">8</option>

										<option value="9">9</option>

									</select>					

							</td>

					</tr>

					<tr align="left">

							<td align="left" valign="top">SPN06A: For how long:</td>

					</tr>

					<tr align="left">

							<td align="left" <?php if($row['spn06_a'] == ''||$row['spn06_a'] == '0'){?>bgcolor="#F7A244"<?php }?>>

								<select name="t5">

										<option value="0">0</option>

										<option value="1">1</option>

										<option value="2">2</option>

										<option value="3">3</option>

										<option value="4">4</option>

										<option value="5">5</option>

										<option value="6">6</option>

										<option value="7">7</option>

										<option value="8">8</option>

										<option value="9">9</option>

									</select> 

									<select name="t6">

										<option value="0">0</option>

										<option value="1">1</option>

										<option value="2">2</option>

										<option value="3">3</option>

										<option value="4">4</option>

										<option value="5">5</option>

										<option value="6">6</option>

										<option value="7">7</option>

										<option value="8">8</option>

										<option value="9">9</option>

									</select>&nbsp;&nbsp;yrs						

							</td>

					</tr>

					<tr>

							<td  align="right">

								<input type="submit" value="Next" class="input-box" />&nbsp;

							</td>

					</tr>	

				</table>

		</form>

		<?php } ?>

		<?php if ($serial=='spn02by'){

				$sql="SELECT spn04_b, spn05_b, spn06_b FROM adult_question WHERE hid = '$hid' and resp_id = '$respondent'";

				$result = mysql_query($sql) or die ("problem budget_heads");

				$row = mysql_fetch_assoc($result);

		?>

			<form action="answer.php?qus=spn02by" method="post">

				<table align="center" class="table_border" >

					<tr align="left">

							<td align="left" valign="top">Hukka:</td>

					</tr>

					<tr align="left">

							<td align="left" valign="top">SPN04B: How often ?</td>

					</tr>

					<tr align="left">

							<td align="left" <?php if($row['spn04_b'] == ''||$row['spn04_b'] == '00'){?>bgcolor="#F7A244"<?php }?>>

									 <select name="t1">

										<option value="0">0</option>

										<option value="1">1</option>

										<option value="2">2</option>

										<option value="3">3</option>

										<option value="4">4</option>

										<option value="5">5</option>

										<option value="6">6</option>

										<option value="7">7</option>

										<option value="8">8</option>

										<option value="9">9</option>

									</select> 

									<select name="t2">

										<option value="0">0</option>

										<option value="1">1</option>

										<option value="2">2</option>

										<option value="3">3</option>

										<option value="4">4</option>

										<option value="5">5</option>

										<option value="6">6</option>

										<option value="7">7</option>

										<option value="8">8</option>

										<option value="9">9</option>

									</select>&nbsp;&nbsp;per day					

							</td>

					</tr>

					<tr align="left">

							<td align="left" valign="top">SPN05B: Starting Age :</td>

					</tr>

					<tr align="left">

							<td align="left" <?php if($row['spn05_b'] == ''||$row['spn05_b'] == '0'){?>bgcolor="#F7A244"<?php }?>>

								<select name="t3">

										<option value="0">0</option>

										<option value="1">1</option>

										<option value="2">2</option>

										<option value="3">3</option>

										<option value="4">4</option>

										<option value="5">5</option>

										<option value="6">6</option>

										<option value="7">7</option>

										<option value="8">8</option>

										<option value="9">9</option>

									</select> 

									<select name="t4">

										<option value="0">0</option>

										<option value="1">1</option>

										<option value="2">2</option>

										<option value="3">3</option>

										<option value="4">4</option>

										<option value="5">5</option>

										<option value="6">6</option>

										<option value="7">7</option>

										<option value="8">8</option>

										<option value="9">9</option>

									</select>					

							</td>

					</tr>

					<tr align="left">

							<td align="left" valign="top">SPN06B: For how long ?</td>

					</tr>

					<tr align="left">

							<td align="left" <?php if($row['spn06_b'] == ''||$row['spn06_b'] == '0'){?>bgcolor="#F7A244"<?php }?>>

								<select name="t5">

										<option value="0">0</option>

										<option value="1">1</option>

										<option value="2">2</option>

										<option value="3">3</option>

										<option value="4">4</option>

										<option value="5">5</option>

										<option value="6">6</option>

										<option value="7">7</option>

										<option value="8">8</option>

										<option value="9">9</option>

									</select> 

									<select name="t6">

										<option value="0">0</option>

										<option value="1">1</option>

										<option value="2">2</option>

										<option value="3">3</option>

										<option value="4">4</option>

										<option value="5">5</option>

										<option value="6">6</option>

										<option value="7">7</option>

										<option value="8">8</option>

										<option value="9">9</option>

									</select>&nbsp;&nbsp;yrs						

							</td>

					</tr>

					<tr>

							<td  align="right">

								<input type="submit" value="Next" class="input-box" />&nbsp;

							</td>

					</tr>	

				</table>

		</form>

		<?php } ?>

		<?php if ($serial=='spn02cy'){

				$sql="SELECT spn04_c, spn05_c, spn06_c FROM adult_question WHERE hid = '$hid' and resp_id = '$respondent'";

				$result = mysql_query($sql) or die ("problem budget_heads");

				$row = mysql_fetch_assoc($result);

		?>

			<form action="answer.php?qus=spn02cy" method="post">

				<table align="center" class="table_border" >

					<tr align="left">

							<td align="left" valign="top">Smoking(Biri):</td>

					</tr>

					<tr align="left">

							<td align="left" valign="top">SPN04A: How often ?</td>

					</tr>

					<tr align="left">

							<td align="left" <?php if($row['spn04_c'] == ''||$row['spn04_c'] == '00'){?>bgcolor="#F7A244"<?php }?>>

									 <select name="t1">

										<option value="0">0</option>

										<option value="1">1</option>

										<option value="2">2</option>

										<option value="3">3</option>

										<option value="4">4</option>

										<option value="5">5</option>

										<option value="6">6</option>

										<option value="7">7</option>

										<option value="8">8</option>

										<option value="9">9</option>

									</select> 

									<select name="t2">

										<option value="0">0</option>

										<option value="1">1</option>

										<option value="2">2</option>

										<option value="3">3</option>

										<option value="4">4</option>

										<option value="5">5</option>

										<option value="6">6</option>

										<option value="7">7</option>

										<option value="8">8</option>

										<option value="9">9</option>

									</select>	&nbsp;&nbsp;per day				

							</td>

					</tr>

					<tr align="left">

							<td align="left" valign="top">SPN05A: Starting Age :</td>

					</tr>

					<tr align="left">

							<td align="left" <?php if($row['spn05_c'] == ''||$row['spn05_c'] == '0'){?>bgcolor="#F7A244"<?php }?>>

								<select name="t3">

										<option value="0">0</option>

										<option value="1">1</option>

										<option value="2">2</option>

										<option value="3">3</option>

										<option value="4">4</option>

										<option value="5">5</option>

										<option value="6">6</option>

										<option value="7">7</option>

										<option value="8">8</option>

										<option value="9">9</option>

									</select> 

									<select name="t4">

										<option value="0">0</option>

										<option value="1">1</option>

										<option value="2">2</option>

										<option value="3">3</option>

										<option value="4">4</option>

										<option value="5">5</option>

										<option value="6">6</option>

										<option value="7">7</option>

										<option value="8">8</option>

										<option value="9">9</option>

									</select>					

							</td>

					</tr>

					<tr align="left">

							<td align="left" valign="top">SPN06A: For how long ?</td>

					</tr>

					<tr align="left">

							<td align="left" <?php if($row['spn06_c'] == ''||$row['spn06_c'] == '0'){?>bgcolor="#F7A244"<?php }?>>

								<select name="t5">

										<option value="0">0</option>

										<option value="1">1</option>

										<option value="2">2</option>

										<option value="3">3</option>

										<option value="4">4</option>

										<option value="5">5</option>

										<option value="6">6</option>

										<option value="7">7</option>

										<option value="8">8</option>

										<option value="9">9</option>

									</select> 

									<select name="t6">

										<option value="0">0</option>

										<option value="1">1</option>

										<option value="2">2</option>

										<option value="3">3</option>

										<option value="4">4</option>

										<option value="5">5</option>

										<option value="6">6</option>

										<option value="7">7</option>

										<option value="8">8</option>

										<option value="9">9</option>

									</select>&nbsp;&nbsp;yrs						

							</td>

					</tr>

					<tr>

							<td  align="right">

								<input type="submit" value="Next" class="input-box" />&nbsp;

							</td>

					</tr>	

				</table>

		</form>

		<?php } ?>

		<?php if ($serial=='spn02dy'){

				$sql="SELECT spn04_d, spn05_d, spn06_d FROM adult_question WHERE hid = '$hid' and resp_id = '$respondent'";

				$result = mysql_query($sql) or die ("problem budget_heads");

				$row = mysql_fetch_assoc($result);

		?>

			<form action="answer.php?qus=spn02dy" method="post">

				<table align="center" class="table_border" >

					<tr align="left">

							<td align="left" valign="top">Smoking(Cigarettes):</td>

					</tr>

					<tr align="left">

							<td align="left" valign="top">SPN04D: How often ?</td>

					</tr>

					<tr align="left">

							<td align="left" <?php if($row['spn04_d'] == ''||$row['spn04_d'] == '00'){?>bgcolor="#F7A244"<?php }?>>

									 <select name="t1">

										<option value="0">0</option>

										<option value="1">1</option>

										<option value="2">2</option>

										<option value="3">3</option>

										<option value="4">4</option>

										<option value="5">5</option>

										<option value="6">6</option>

										<option value="7">7</option>

										<option value="8">8</option>

										<option value="9">9</option>

									</select> 

									<select name="t2">

										<option value="0">0</option>

										<option value="1">1</option>

										<option value="2">2</option>

										<option value="3">3</option>

										<option value="4">4</option>

										<option value="5">5</option>

										<option value="6">6</option>

										<option value="7">7</option>

										<option value="8">8</option>

										<option value="9">9</option>

									</select>	&nbsp;&nbsp;per day				

							</td>

					</tr>

					<tr align="left">

							<td align="left" valign="top">SPN05D: Starting Age :</td>

					</tr>

					<tr align="left">

							<td align="left" <?php if($row['spn05_d'] == ''||$row['spn05_d'] == '0'){?>bgcolor="#F7A244"<?php }?>>

								<select name="t3">

										<option value="0">0</option>

										<option value="1">1</option>

										<option value="2">2</option>

										<option value="3">3</option>

										<option value="4">4</option>

										<option value="5">5</option>

										<option value="6">6</option>

										<option value="7">7</option>

										<option value="8">8</option>

										<option value="9">9</option>

									</select> 

									<select name="t4">

										<option value="0">0</option>

										<option value="1">1</option>

										<option value="2">2</option>

										<option value="3">3</option>

										<option value="4">4</option>

										<option value="5">5</option>

										<option value="6">6</option>

										<option value="7">7</option>

										<option value="8">8</option>

										<option value="9">9</option>

									</select>					

							</td>

					</tr>

					<tr align="left">

							<td align="left" valign="top">SPN06D: For how long ? </td>

					</tr>

					<tr align="left">

							<td align="left" <?php if($row['spn06_d'] == ''||$row['spn06_d'] == '0'){?>bgcolor="#F7A244"<?php }?>>

								<select name="t5">

										<option value="0">0</option>

										<option value="1">1</option>

										<option value="2">2</option>

										<option value="3">3</option>

										<option value="4">4</option>

										<option value="5">5</option>

										<option value="6">6</option>

										<option value="7">7</option>

										<option value="8">8</option>

										<option value="9">9</option>

									</select> 

									<select name="t6">

										<option value="0">0</option>

										<option value="1">1</option>

										<option value="2">2</option>

										<option value="3">3</option>

										<option value="4">4</option>

										<option value="5">5</option>

										<option value="6">6</option>

										<option value="7">7</option>

										<option value="8">8</option>

										<option value="9">9</option>

									</select>						

							</td>

					</tr>

					<tr>

							<td  align="right">

								<input type="submit" value="Next" class="input-box" />&nbsp;

							</td>

					</tr>	

				</table>

		</form>

		<?php } ?>

		<?php if ($serial=='spn02ey'){

			$sql="SELECT spn04_e, spn05_e, spn06_e FROM adult_question WHERE hid = '$hid' and resp_id = '$respondent'";

				$result = mysql_query($sql) or die ("problem budget_heads");

				$row = mysql_fetch_assoc($result);

		?>

			<form action="answer.php?qus=spn02ey" method="post">

				<table align="center" class="table_border" >

					<tr align="left">

							<td align="left" valign="top">Gul :</td>

					</tr>

					<tr align="left">

							<td align="left" valign="top">SPN04E: How often ?</td>

					</tr>

					<tr align="left">

							<td align="left" <?php if($row['spn04_e'] == ''||$row['spn04_e'] == '00'){?>bgcolor="#F7A244"<?php }?>>

									 <select name="t1">

										<option value="0">0</option>

										<option value="1">1</option>

										<option value="2">2</option>

										<option value="3">3</option>

										<option value="4">4</option>

										<option value="5">5</option>

										<option value="6">6</option>

										<option value="7">7</option>

										<option value="8">8</option>

										<option value="9">9</option>

									</select> 

									<select name="t2">

										<option value="0">0</option>

										<option value="1">1</option>

										<option value="2">2</option>

										<option value="3">3</option>

										<option value="4">4</option>

										<option value="5">5</option>

										<option value="6">6</option>

										<option value="7">7</option>

										<option value="8">8</option>

										<option value="9">9</option>

									</select>&nbsp;&nbsp;per day					

							</td>

					</tr>

					<tr align="left">

							<td align="left" valign="top">SPN05E: Starting Age :</td>

					</tr>

					<tr align="left">

							<td align="left" <?php if($row['spn05_e'] == ''||$row['spn05_e'] == '0'){?>bgcolor="#F7A244"<?php }?>>

								<select name="t3">

										<option value="0">0</option>

										<option value="1">1</option>

										<option value="2">2</option>

										<option value="3">3</option>

										<option value="4">4</option>

										<option value="5">5</option>

										<option value="6">6</option>

										<option value="7">7</option>

										<option value="8">8</option>

										<option value="9">9</option>

									</select> 

									<select name="t4">

										<option value="0">0</option>

										<option value="1">1</option>

										<option value="2">2</option>

										<option value="3">3</option>

										<option value="4">4</option>

										<option value="5">5</option>

										<option value="6">6</option>

										<option value="7">7</option>

										<option value="8">8</option>

										<option value="9">9</option>

									</select>					

							</td>

					</tr>

					<tr align="left">

							<td align="left" valign="top">SPN06E: For how long ?</td>

					</tr>

					<tr align="left">

							<td align="left" <?php if($row['spn06_e'] == ''||$row['spn06_e'] == '0'){?>bgcolor="#F7A244"<?php }?>>

								<select name="t5">

										<option value="0">0</option>

										<option value="1">1</option>

										<option value="2">2</option>

										<option value="3">3</option>

										<option value="4">4</option>

										<option value="5">5</option>

										<option value="6">6</option>

										<option value="7">7</option>

										<option value="8">8</option>

										<option value="9">9</option>

									</select> 

									<select name="t6">

										<option value="0">0</option>

										<option value="1">1</option>

										<option value="2">2</option>

										<option value="3">3</option>

										<option value="4">4</option>

										<option value="5">5</option>

										<option value="6">6</option>

										<option value="7">7</option>

										<option value="8">8</option>

										<option value="9">9</option>

									</select>						

							</td>

					</tr>

					<tr>

							<td  align="right">

								<input type="submit" value="Next" class="input-box" />&nbsp;

							</td>

					</tr>	

				</table>

		</form>

		<?php } ?>

		<?php if ($serial=='spn02n'){?>

			<form action="answer.php?qus=spn02n" method="post">

				<table align="center" class="table_border" >

					<tr align="left">

							<td align="left" valign="top">Chewing Pan:</td>

					</tr>

					<tr align="left">

							<td align="left" valign="top">SPN05A: Starting Age :</td>

					</tr>

					<tr align="left">

							<td align="left" <?php if($row['spn05_a'] == ''||$row['spn05_a'] == '0'){?>bgcolor="#F7A244"<?php }?>>

								<select name="t3">

										<option value="0">0</option>

										<option value="1">1</option>

										<option value="2">2</option>

										<option value="3">3</option>

										<option value="4">4</option>

										<option value="5">5</option>

										<option value="6">6</option>

										<option value="7">7</option>

										<option value="8">8</option>

										<option value="9">9</option>

									</select> 

									<select name="t4">

										<option value="0">0</option>

										<option value="1">1</option>

										<option value="2">2</option>

										<option value="3">3</option>

										<option value="4">4</option>

										<option value="5">5</option>

										<option value="6">6</option>

										<option value="7">7</option>

										<option value="8">8</option>

										<option value="9">9</option>

									</select>					

							</td>

					</tr>

					<tr align="left">

							<td align="left" valign="top">SPN03A: Ending Age:</td>

					</tr>

					<tr align="left">

							<td align="left" <?php if($row['spn03_a'] == ''||$row['spn03_a'] == '00'){?>bgcolor="#F7A244"<?php }?>>

									 <select name="t7">

										<option value="0">0</option>

										<option value="1">1</option>

										<option value="2">2</option>

										<option value="3">3</option>

										<option value="4">4</option>

										<option value="5">5</option>

										<option value="6">6</option>

										<option value="7">7</option>

										<option value="8">8</option>

										<option value="9">9</option>

									</select> 

									<select name="t8">

										<option value="0">0</option>

										<option value="1">1</option>

										<option value="2">2</option>

										<option value="3">3</option>

										<option value="4">4</option>

										<option value="5">5</option>

										<option value="6">6</option>

										<option value="7">7</option>

										<option value="8">8</option>

										<option value="9">9</option>

									</select>					

							</td>

					</tr>

					<tr align="left">

							<td align="left" valign="top">SPN06A: How many years:</td>

					</tr>

					<tr align="left">

							<td align="left" <?php if($row['spn06_c'] == ''||$row['spn06_c'] == '0'){?>bgcolor="#F7A244"<?php }?>>

								<select name="t5">

										<option value="0">0</option>

										<option value="1">1</option>

										<option value="2">2</option>

										<option value="3">3</option>

										<option value="4">4</option>

										<option value="5">5</option>

										<option value="6">6</option>

										<option value="7">7</option>

										<option value="8">8</option>

										<option value="9">9</option>

									</select> 

									<select name="t6">

										<option value="0">0</option>

										<option value="1">1</option>

										<option value="2">2</option>

										<option value="3">3</option>

										<option value="4">4</option>

										<option value="5">5</option>

										<option value="6">6</option>

										<option value="7">7</option>

										<option value="8">8</option>

										<option value="9">9</option>

									</select>						

							</td>

					</tr>

					<tr align="left">

							<td align="left" valign="top">SPN04A: How often ?</td>

					</tr>

					<tr align="left">

							<td align="left" <?php if($row['spn04_a'] == ''||$row['spn04_a'] == '00'){?>bgcolor="#F7A244"<?php }?>>

									 <select name="t1">

										<option value="0">0</option>

										<option value="1">1</option>

										<option value="2">2</option>

										<option value="3">3</option>

										<option value="4">4</option>

										<option value="5">5</option>

										<option value="6">6</option>

										<option value="7">7</option>

										<option value="8">8</option>

										<option value="9">9</option>

									</select> 

									<select name="t2">

										<option value="0">0</option>

										<option value="1">1</option>

										<option value="2">2</option>

										<option value="3">3</option>

										<option value="4">4</option>

										<option value="5">5</option>

										<option value="6">6</option>

										<option value="7">7</option>

										<option value="8">8</option>

										<option value="9">9</option>

									</select>	&nbsp;&nbsp;per day				

							</td>

					</tr>

					<tr>

							<td  align="right">

								<input type="submit" value="Next" class="input-box" />&nbsp;

							</td>

					</tr>	

				</table>

		</form>

		<?php } ?>

		<?php if ($serial=='spn02bn'){?>

			<form action="answer.php?qus=spn02bn" method="post">

				<table align="center" class="table_border" >

					<tr align="left">

							<td align="left" valign="top">Hukka:</td>

					</tr>

					<tr align="left">

							<td align="left" valign="top">SPN03B: Quit when ?</td>

					</tr>

					<tr align="left">

							<td align="left" <?php if($row['spn03_b'] == ''||$row['spn03_b'] == '00'){?>bgcolor="#F7A244"<?php }?>>

									 <select name="t7">

										<option value="0">0</option>

										<option value="1">1</option>

										<option value="2">2</option>

										<option value="3">3</option>

										<option value="4">4</option>

										<option value="5">5</option>

										<option value="6">6</option>

										<option value="7">7</option>

										<option value="8">8</option>

										<option value="9">9</option>

									</select> 

									<select name="t8">

										<option value="0">0</option>

										<option value="1">1</option>

										<option value="2">2</option>

										<option value="3">3</option>

										<option value="4">4</option>

										<option value="5">5</option>

										<option value="6">6</option>

										<option value="7">7</option>

										<option value="8">8</option>

										<option value="9">9</option>

									</select>&nbsp;&nbsp;yrs				

							</td>

					</tr>

					<tr align="left">

							<td align="left" valign="top">SPN04B: How often ?</td>

					</tr>

					<tr align="left">

							<td align="left" <?php if($row['spn04_b'] == ''||$row['spn04_b'] == '00'){?>bgcolor="#F7A244"<?php }?>>

									 <select name="t1">

										<option value="0">0</option>

										<option value="1">1</option>

										<option value="2">2</option>

										<option value="3">3</option>

										<option value="4">4</option>

										<option value="5">5</option>

										<option value="6">6</option>

										<option value="7">7</option>

										<option value="8">8</option>

										<option value="9">9</option>

									</select> 

									<select name="t2">

										<option value="0">0</option>

										<option value="1">1</option>

										<option value="2">2</option>

										<option value="3">3</option>

										<option value="4">4</option>

										<option value="5">5</option>

										<option value="6">6</option>

										<option value="7">7</option>

										<option value="8">8</option>

										<option value="9">9</option>

									</select>	&nbsp;&nbsp;per day				

							</td>

					</tr>

					<tr align="left">

							<td align="left" valign="top">SPN05B: Starting Age :</td>

					</tr>

					<tr align="left">

							<td align="left" <?php if($row['spn05_b'] == ''||$row['spn05_b'] == '0'){?>bgcolor="#F7A244"<?php }?>>

								<select name="t3">

										<option value="0">0</option>

										<option value="1">1</option>

										<option value="2">2</option>

										<option value="3">3</option>

										<option value="4">4</option>

										<option value="5">5</option>

										<option value="6">6</option>

										<option value="7">7</option>

										<option value="8">8</option>

										<option value="9">9</option>

									</select> 

									<select name="t4">

										<option value="0">0</option>

										<option value="1">1</option>

										<option value="2">2</option>

										<option value="3">3</option>

										<option value="4">4</option>

										<option value="5">5</option>

										<option value="6">6</option>

										<option value="7">7</option>

										<option value="8">8</option>

										<option value="9">9</option>

									</select>					

							</td>

					</tr>

					<tr align="left">

							<td align="left" valign="top">SPN06B: For how long ?</td>

					</tr>

					<tr align="left">

							<td align="left" <?php if($row['spn06_b'] == ''||$row['spn06_b'] == '0'){?>bgcolor="#F7A244"<?php }?>>

								<select name="t5">

										<option value="0">0</option>

										<option value="1">1</option>

										<option value="2">2</option>

										<option value="3">3</option>

										<option value="4">4</option>

										<option value="5">5</option>

										<option value="6">6</option>

										<option value="7">7</option>

										<option value="8">8</option>

										<option value="9">9</option>

									</select> 

									<select name="t6">

										<option value="0">0</option>

										<option value="1">1</option>

										<option value="2">2</option>

										<option value="3">3</option>

										<option value="4">4</option>

										<option value="5">5</option>

										<option value="6">6</option>

										<option value="7">7</option>

										<option value="8">8</option>

										<option value="9">9</option>

									</select>&nbsp;&nbsp;yrs						

							</td>

					</tr>

					<tr>

							<td  align="right">

								<input type="submit" value="Next" class="input-box" />&nbsp;

							</td>

					</tr>	

				</table>

		</form>

		<?php } ?>

		<?php if ($serial=='spn02cn'){?>

			<form action="answer.php?qus=spn02cn" method="post">

				<table align="center" class="table_border" >

					<tr align="left">

							<td align="left" valign="top">Smoking(Biri):</td>

					</tr>

					<tr align="left">

							<td align="left" valign="top">SPN03C: Quit when ?</td>

					</tr>

					<tr align="left">

							<td align="left" <?php if($row['spn03_c'] == ''||$row['spn03_c'] == '00'){?>bgcolor="#F7A244"<?php }?>>

									 <select name="t7">

										<option value="0">0</option>

										<option value="1">1</option>

										<option value="2">2</option>

										<option value="3">3</option>

										<option value="4">4</option>

										<option value="5">5</option>

										<option value="6">6</option>

										<option value="7">7</option>

										<option value="8">8</option>

										<option value="9">9</option>

									</select> 

									<select name="t8">

										<option value="0">0</option>

										<option value="1">1</option>

										<option value="2">2</option>

										<option value="3">3</option>

										<option value="4">4</option>

										<option value="5">5</option>

										<option value="6">6</option>

										<option value="7">7</option>

										<option value="8">8</option>

										<option value="9">9</option>

									</select>&nbsp;&nbsp;yrs			

							</td>

					</tr>

					<tr align="left">

							<td align="left" valign="top">SPN04C: How often ?</td>

					</tr>

					<tr align="left">

							<td align="left" <?php if($row['spn04_c'] == ''||$row['spn04_c'] == '00'){?>bgcolor="#F7A244"<?php }?>>

									 <select name="t1">

										<option value="0">0</option>

										<option value="1">1</option>

										<option value="2">2</option>

										<option value="3">3</option>

										<option value="4">4</option>

										<option value="5">5</option>

										<option value="6">6</option>

										<option value="7">7</option>

										<option value="8">8</option>

										<option value="9">9</option>

									</select> 

									<select name="t2">

										<option value="0">0</option>

										<option value="1">1</option>

										<option value="2">2</option>

										<option value="3">3</option>

										<option value="4">4</option>

										<option value="5">5</option>

										<option value="6">6</option>

										<option value="7">7</option>

										<option value="8">8</option>

										<option value="9">9</option>

									</select>	&nbsp;&nbsp;per day				

							</td>

					</tr>

					<tr align="left">

							<td align="left" valign="top">SPN05C: Starting Age :</td>

					</tr>

					<tr align="left">

							<td align="left" <?php if($row['spn05_c'] == ''||$row['spn05_c'] == '0'){?>bgcolor="#F7A244"<?php }?>>

								<select name="t3">

										<option value="0">0</option>

										<option value="1">1</option>

										<option value="2">2</option>

										<option value="3">3</option>

										<option value="4">4</option>

										<option value="5">5</option>

										<option value="6">6</option>

										<option value="7">7</option>

										<option value="8">8</option>

										<option value="9">9</option>

									</select> 

									<select name="t4">

										<option value="0">0</option>

										<option value="1">1</option>

										<option value="2">2</option>

										<option value="3">3</option>

										<option value="4">4</option>

										<option value="5">5</option>

										<option value="6">6</option>

										<option value="7">7</option>

										<option value="8">8</option>

										<option value="9">9</option>

									</select>					

							</td>

					</tr>

					<tr align="left">

							<td align="left" valign="top">SPN06C: For how long ?</td>

					</tr>

					<tr align="left">

							<td align="left" <?php if($row['spn06_c'] == ''||$row['spn06_c'] == '00'){?>bgcolor="#F7A244"<?php }?>>

								<select name="t5">

										<option value="0">0</option>

										<option value="1">1</option>

										<option value="2">2</option>

										<option value="3">3</option>

										<option value="4">4</option>

										<option value="5">5</option>

										<option value="6">6</option>

										<option value="7">7</option>

										<option value="8">8</option>

										<option value="9">9</option>

									</select> 

									<select name="t6">

										<option value="0">0</option>

										<option value="1">1</option>

										<option value="2">2</option>

										<option value="3">3</option>

										<option value="4">4</option>

										<option value="5">5</option>

										<option value="6">6</option>

										<option value="7">7</option>

										<option value="8">8</option>

										<option value="9">9</option>

									</select>&nbsp;&nbsp;yrs						

							</td>

					</tr>

					<tr>

							<td  align="right">

								<input type="submit" value="Next" class="input-box" />&nbsp;

							</td>

					</tr>	

				</table>

		</form>

		<?php } ?>

		<?php if ($serial=='spn02dn'){?>

			<form action="answer.php?qus=spn02dn" method="post">

				<table align="center" class="table_border" >

					<tr align="left">

							<td align="left" valign="top">Smoking(Cigarettes):</td>

					</tr>

					<tr align="left">

							<td align="left" valign="top">SPN03D: Quit when ?</td>

					</tr>

					<tr align="left">

							<td align="left" <?php if($row['spn03_d'] == ''||$row['spn03_d'] == '00'){?>bgcolor="#F7A244"<?php }?>>

									 <select name="t7">

										<option value="0">0</option>

										<option value="1">1</option>

										<option value="2">2</option>

										<option value="3">3</option>

										<option value="4">4</option>

										<option value="5">5</option>

										<option value="6">6</option>

										<option value="7">7</option>

										<option value="8">8</option>

										<option value="9">9</option>

									</select> 

									<select name="t8">

										<option value="0">0</option>

										<option value="1">1</option>

										<option value="2">2</option>

										<option value="3">3</option>

										<option value="4">4</option>

										<option value="5">5</option>

										<option value="6">6</option>

										<option value="7">7</option>

										<option value="8">8</option>

										<option value="9">9</option>

									</select>&nbsp;&nbsp;yrs					

							</td>

					</tr>

					<tr align="left">

							<td align="left" valign="top">SPN04D: How often ?</td>

					</tr>

					<tr align="left">

							<td align="left" <?php if($row['spn04_d'] == ''||$row['spn04_d'] == '00'){?>bgcolor="#F7A244"<?php }?>>

									 <select name="t1">

										<option value="0">0</option>

										<option value="1">1</option>

										<option value="2">2</option>

										<option value="3">3</option>

										<option value="4">4</option>

										<option value="5">5</option>

										<option value="6">6</option>

										<option value="7">7</option>

										<option value="8">8</option>

										<option value="9">9</option>

									</select> 

									<select name="t2">

										<option value="0">0</option>

										<option value="1">1</option>

										<option value="2">2</option>

										<option value="3">3</option>

										<option value="4">4</option>

										<option value="5">5</option>

										<option value="6">6</option>

										<option value="7">7</option>

										<option value="8">8</option>

										<option value="9">9</option>

									</select>	&nbsp;&nbsp;per day				

							</td>

					</tr>

					<tr align="left">

							<td align="left" valign="top">SPN05D: Starting Age :</td>

					</tr>

					<tr align="left">

							<td align="left" <?php if($row['spn05_d'] == ''||$row['spn05_d'] == '00'){?>bgcolor="#F7A244"<?php }?>>

								<select name="t3">

										<option value="0">0</option>

										<option value="1">1</option>

										<option value="2">2</option>

										<option value="3">3</option>

										<option value="4">4</option>

										<option value="5">5</option>

										<option value="6">6</option>

										<option value="7">7</option>

										<option value="8">8</option>

										<option value="9">9</option>

									</select> 

									<select name="t4">

										<option value="0">0</option>

										<option value="1">1</option>

										<option value="2">2</option>

										<option value="3">3</option>

										<option value="4">4</option>

										<option value="5">5</option>

										<option value="6">6</option>

										<option value="7">7</option>

										<option value="8">8</option>

										<option value="9">9</option>

									</select>					

							</td>

					</tr>

					<tr align="left">

							<td align="left" valign="top">SPN06D: For how long ?</td>

					</tr>

					<tr align="left">

							<td align="left" <?php if($row['spn06_d'] == ''||$row['spn06_d'] == '00'){?>bgcolor="#F7A244"<?php }?>>

								<select name="t5">

										<option value="0">0</option>

										<option value="1">1</option>

										<option value="2">2</option>

										<option value="3">3</option>

										<option value="4">4</option>

										<option value="5">5</option>

										<option value="6">6</option>

										<option value="7">7</option>

										<option value="8">8</option>

										<option value="9">9</option>

									</select> 

									<select name="t6">

										<option value="0">0</option>

										<option value="1">1</option>

										<option value="2">2</option>

										<option value="3">3</option>

										<option value="4">4</option>

										<option value="5">5</option>

										<option value="6">6</option>

										<option value="7">7</option>

										<option value="8">8</option>

										<option value="9">9</option>

									</select>&nbsp;&nbsp;yrs						

							</td>

					</tr>

					<tr>

							<td  align="right">

								<input type="submit" value="Next" class="input-box" />&nbsp;

							</td>

					</tr>	

				</table>

		</form>

		<?php } ?>

		<?php if ($serial=='spn02en'){?>

			<form action="answer.php?qus=spn02en" method="post">

				<table align="center" class="table_border" >

					<tr align="left">

							<td align="left" valign="top">Gul:</td>

					</tr>

					<tr align="left">

							<td align="left" valign="top">SPN03E: Quit when ?</td>

					</tr>

					<tr align="left">

							<td align="left" <?php if($row['spn03_e'] == ''||$row['spn03_e'] == '00'){?>bgcolor="#F7A244"<?php }?>>

									 <select name="t7">

										<option value="0">0</option>

										<option value="1">1</option>

										<option value="2">2</option>

										<option value="3">3</option>

										<option value="4">4</option>

										<option value="5">5</option>

										<option value="6">6</option>

										<option value="7">7</option>

										<option value="8">8</option>

										<option value="9">9</option>

									</select> 

									<select name="t8">

										<option value="0">0</option>

										<option value="1">1</option>

										<option value="2">2</option>

										<option value="3">3</option>

										<option value="4">4</option>

										<option value="5">5</option>

										<option value="6">6</option>

										<option value="7">7</option>

										<option value="8">8</option>

										<option value="9">9</option>

									</select>&nbsp;&nbsp;yrs					

							</td>

					</tr>

					<tr align="left">

							<td align="left" valign="top">SPN04E: How often ?</td>

					</tr>

					<tr align="left">

							<td align="left" <?php if($row['spn04_e'] == ''||$row['spn04_e'] == '00'){?>bgcolor="#F7A244"<?php }?>>

									 <select name="t1">

										<option value="0">0</option>

										<option value="1">1</option>

										<option value="2">2</option>

										<option value="3">3</option>

										<option value="4">4</option>

										<option value="5">5</option>

										<option value="6">6</option>

										<option value="7">7</option>

										<option value="8">8</option>

										<option value="9">9</option>

									</select> 

									<select name="t2">

										<option value="0">0</option>

										<option value="1">1</option>

										<option value="2">2</option>

										<option value="3">3</option>

										<option value="4">4</option>

										<option value="5">5</option>

										<option value="6">6</option>

										<option value="7">7</option>

										<option value="8">8</option>

										<option value="9">9</option>

									</select>	&nbsp;&nbsp;per day				

							</td>

					</tr>

					<tr align="left">

							<td align="left" valign="top">SPN05E: Starting Age :</td>

					</tr>

					<tr align="left">

							<td align="left" <?php if($row['spn05_e'] == ''||$row['spn05_e'] == '00'){?>bgcolor="#F7A244"<?php }?>>

								<select name="t3">

										<option value="0">0</option>

										<option value="1">1</option>

										<option value="2">2</option>

										<option value="3">3</option>

										<option value="4">4</option>

										<option value="5">5</option>

										<option value="6">6</option>

										<option value="7">7</option>

										<option value="8">8</option>

										<option value="9">9</option>

									</select> 

									<select name="t4">

										<option value="0">0</option>

										<option value="1">1</option>

										<option value="2">2</option>

										<option value="3">3</option>

										<option value="4">4</option>

										<option value="5">5</option>

										<option value="6">6</option>

										<option value="7">7</option>

										<option value="8">8</option>

										<option value="9">9</option>

									</select>					

							</td>

					</tr>

					<tr align="left">

							<td align="left" valign="top">SPN06E: For how long ?</td>

					</tr>

					<tr align="left">

							<td align="left" <?php if($row['spn06_e'] == ''||$row['spn06_e'] == '00'){?>bgcolor="#F7A244"<?php }?>>

								<select name="t5">

										<option value="0">0</option>

										<option value="1">1</option>

										<option value="2">2</option>

										<option value="3">3</option>

										<option value="4">4</option>

										<option value="5">5</option>

										<option value="6">6</option>

										<option value="7">7</option>

										<option value="8">8</option>

										<option value="9">9</option>

									</select> 

									<select name="t6">

										<option value="0">0</option>

										<option value="1">1</option>

										<option value="2">2</option>

										<option value="3">3</option>

										<option value="4">4</option>

										<option value="5">5</option>

										<option value="6">6</option>

										<option value="7">7</option>

										<option value="8">8</option>

										<option value="9">9</option>

									</select>&nbsp;&nbsp;yrs						

							</td>

					</tr>

					<tr>

							<td  align="right">

								<input type="submit" value="Next" class="input-box" />&nbsp;

							</td>

					</tr>	

				</table>

		</form>

		<?php } ?>

		<?php if ($serial=='gh01'){ 

				$sql="SELECT gh01 FROM adult_question WHERE hid = '$hid' and resp_id = '$respondent'";

				$result = mysql_query($sql) or die ("problem budget_heads");

				$row = mysql_fetch_assoc($result);

		?>

				<form action="answer.php?qus=gh01" method="post">

				<table align="center" class="table_border" >

					<tr align="left">

							<td align="left" valign="top">Current General Health:</td>

					</tr>

					<tr align="left">

							<td align="left" valign="top">GH01: Physical Sitaution:</td>

					</tr>

					<tr align="left">

							<td align="left" <?php if($row['gh01'] == ''||$row['gh01'] == '0'){?>bgcolor="#F7A244"<?php }?>>

								<select name="gh01">

									 <?php

											if($row['gh01'] == ''||$row['gh01'] == '0'){

											 echo "<option value='0' selected='selected'> Select</option>";

											}

											else{

												$hop=$row['gh01'];

												$sql1="SELECT value from retreive_data WHERE qus='gh01' and hoption='$hop' ";

												$result1= mysql_query($sql1) or die ("problem 2ND BLOCK OF RESPONDENT");

												$value = mysql_fetch_assoc($result1);

												$mv= $value['value'];

												echo "<option value='$hop' selected='selected'> $hop-$mv</option>";

											}

										?>

									<option value="1">1-Good</option>

									<option value="2">2-Moderate</option>

									<option value="3">3-Bad</option>

								</select>					

							</td>

					</tr>

					<tr>

							<td  align="right">

								<input type="submit" value="Next" class="input-box" />&nbsp;

							</td>

					</tr>	

				</table>

		</form>

	<?php } ?>

	<?php if ($serial=='gh02'){ 

				$sql="SELECT gh02 FROM adult_question WHERE hid = '$hid' and resp_id = '$respondent'";

				$result = mysql_query($sql) or die ("problem budget_heads");

				$row = mysql_fetch_assoc($result);

		?>

				<form action="answer.php?qus=gh02" method="post">

				<table align="center" class="table_border" >

					<tr align="left">

							<td align="left" valign="top"> General Health:</td>

					</tr>

					<tr align="left">

							<td align="left" valign="top">GH02: Moderate how ?</td>

					</tr>

					<tr align="left">

							<td align="left" <?php if($row['gh02'] == ''||$row['gh02'] == '0'){?>bgcolor="#F7A244"<?php }?>>

								<select name="gh02">

									 <?php

											if($row['gh02'] == ''||$row['gh02'] == '0'){

											 echo "<option value='0' selected='selected'> Select</option>";

											}

											else{

												$hop=$row['gh02'];

												$sql1="SELECT value from retreive_data WHERE qus='gh02' and hoption='$hop' ";

												$result1= mysql_query($sql1) or die ("problem 2ND BLOCK OF RESPONDENT");

												$value = mysql_fetch_assoc($result1);

												$mv= $value['value'];

												echo "<option value='$hop' selected='selected'> $hop-$mv</option>";

											}

										?>

									<option value="1">1-Better than average</option>

									<option value="2">2-Worse than average</option>

								</select>					

							</td>

					</tr>

					<tr>

							<td  align="right">

								<input type="submit" value="Next" class="input-box" />&nbsp;

							</td>

					</tr>	

				</table>

		</form>

	<?php } ?>

	<?php if ($serial=='gh03'){ 

				$sql="SELECT gh03 FROM adult_question WHERE hid = '$hid' and resp_id = '$respondent'";

				$result = mysql_query($sql) or die ("problem budget_heads");

				$row = mysql_fetch_assoc($result);

		?>

				<form action="answer.php?qus=gh03" method="post">

				<table align="center" class="table_border" >

					<tr align="left">

							<td align="left" valign="top"> General Health:</td>

					</tr>

					<tr align="left">

							<td align="left" valign="top">GH03: Feeling worse since ?</td>

					</tr>

					<tr align="left">

							<td align="left" <?php if($row['gh03'] == ''||$row['gh03'] == '00'){?>bgcolor="#F7A244"<?php }?>>

								<select name="t1">

										<option value="0">0</option>

										<option value="1">1</option>

										<option value="2">2</option>

										<option value="3">3</option>

										<option value="4">4</option>

										<option value="5">5</option>

										<option value="6">6</option>

										<option value="7">7</option>

										<option value="8">8</option>

										<option value="9">9</option>

									</select> 

									<select name="t2">

										<option value="0">0</option>

										<option value="1">1</option>

										<option value="2">2</option>

										<option value="3">3</option>

										<option value="4">4</option>

										<option value="5">5</option>

										<option value="6">6</option>

										<option value="7">7</option>

										<option value="8">8</option>

										<option value="9">9</option>

									</select>&nbsp;&nbsp;mnths					

							</td>

					</tr>

					<tr>

							<td  align="right">

								<input type="submit" value="Next" class="input-box" />&nbsp;

							</td>

					</tr>	

				</table>

		</form>

	<?php } ?>

	<?php if ($serial=='gh'){ 

				$sql="SELECT gh04, gh05, gh06, gh07 FROM adult_question WHERE hid = '$hid' and resp_id = '$respondent'";

				$result = mysql_query($sql) or die ("problem budget_heads");

				$row = mysql_fetch_assoc($result);

		?>

				<form action="answer.php?qus=gh" method="post">

				<table align="center" class="table_border" >

					<tr align="left">

							<td align="left" valign="top"> General Health:</td>

					</tr>

					<tr align="left">

							<td align="left" valign="top">GH04: Compare to others:</td>

					</tr>

					<tr align="left">

							<td align="left" <?php if($row['gh04'] == ''||$row['gh04'] == '0'){?>bgcolor="#F7A244"<?php }?>>

								<select name="gh04">

									 <?php

											if($row['gh04'] == ''||$row['gh04'] == '0'){

											 echo "<option value='0' selected='selected'> Select</option>";

											}

											else{

												$hop=$row['gh04'];

												$sql1="SELECT value from retreive_data WHERE qus='gh04' and hoption='$hop' ";

												$result1= mysql_query($sql1) or die ("problem 2ND BLOCK OF RESPONDENT");

												$value = mysql_fetch_assoc($result1);

												$mv= $value['value'];

												echo "<option value='$hop' selected='selected'> $hop-$mv</option>";

											}

										?>

									<option value="1"> 1- Better</option>

									<option value="2"> 2- Same</option>

									<option value="3"> 3- Worse</option>

								</select>					

							</td>

					</tr>

					<tr align="left">

							<td align="left" valign="top">GH05: Compare to last year:</td>

					</tr>

					<tr align="left">

							<td align="left" <?php if($row['gh05'] == ''||$row['gh05'] == '0'){?>bgcolor="#F7A244"<?php }?>>

								<select name="gh05">

									 <?php

											if($row['gh05'] == ''||$row['gh05'] == '0'){

											 echo "<option value='0' selected='selected'> Select</option>";

											}

											else{

												$hop=$row['gh05'];

												$sql1="SELECT value from retreive_data WHERE qus='gh05' and hoption='$hop' ";

												$result1= mysql_query($sql1) or die ("problem 2ND BLOCK OF RESPONDENT");

												$value = mysql_fetch_assoc($result1);

												$mv= $value['value'];

												echo "<option value='$hop' selected='selected'> $hop-$mv</option>";

											}

										?>

									<option value="1"> 1- Better</option>

									<option value="2"> 2- Same</option>

									<option value="3"> 3- Worse</option>

								</select>					

							</td>

					</tr>

					<tr align="left">

							<td align="left" valign="top">GH06: Nxt yr expectation:</td>

					</tr>

					<tr align="left">

							<td align="left" <?php if($row['gh06'] == ''||$row['gh06'] == '0'){?>bgcolor="#F7A244"<?php }?>>

								<select name="gh06">

									 <?php

											if($row['gh06'] == ''||$row['gh06'] == '0'){

											 echo "<option value='0' selected='selected'> Select</option>";

											}

											else{

												$hop=$row['gh06'];

												$sql1="SELECT value from retreive_data WHERE qus='gh06' and hoption='$hop' ";

												$result1= mysql_query($sql1) or die ("problem 2ND BLOCK OF RESPONDENT");

												$value = mysql_fetch_assoc($result1);

												$mv= $value['value'];

												echo "<option value='$hop' selected='selected'> $hop-$mv</option>";

											}

										?>

									<option value="1"> 1- Better</option>

									<option value="2"> 2- Same</option>

									<option value="3"> 3- Worse</option>

								</select>					

							</td>

					</tr>

					<tr align="left">

							<td align="left" valign="top">GH07:Intrviewr Obsrvation:</td>

					</tr>

					<tr align="left">

							<td align="left" <?php if($row['gh07'] == ''||$row['gh07'] == '0'){?>bgcolor="#F7A244"<?php }?>>

								<select name="gh07">

									 <?php

											if($row['gh07'] == ''||$row['gh07'] == '0'){

											 echo "<option value='0' selected='selected'> Select</option>";

											}

											else{

												$hop=$row['gh07'];

												$sql1="SELECT value from retreive_data WHERE qus='gh01' and hoption='$hop' ";

												$result1= mysql_query($sql1) or die ("problem 2ND BLOCK OF RESPONDENT");

												$value = mysql_fetch_assoc($result1);

												$mv= $value['value'];

												echo "<option value='$hop' selected='selected'> $hop-$mv</option>";

											}

										?>

									<option value="1"> 1- Good</option>

									<option value="2"> 2- Moderate</option>

									<option value="3"> 3- Bad</option>

								</select>					

							</td>

					</tr>

					<tr>

							<td  align="right">

								<input type="submit" value="Next" class="input-box" />&nbsp;

							</td>

					</tr>	

				</table>

		</form>

		<?php } ?>

		<?php if ($serial=='gh08_a'){ 

				$sql="SELECT gh08_a_1, gh08_a_2, gh08_a_3, gh08_a_4, gh08_a_5, gh08_a_6, gh08_a_7, gh08_a_8, gh08_a_9 FROM adult_question WHERE hid = '$hid' and resp_id = '$respondent'";

				$result = mysql_query($sql) or die ("problem budget_heads");

				$row = mysql_fetch_assoc($result);

		?>

				<form action="answer.php?qus=gh08_a" method="post">

				<table align="center" class="table_border" >

					<tr align="left">

							<td align="left" valign="top"> General Health:</td>

					</tr>

					<tr align="left">

							<td align="left" valign="top">GH08a: Do you have the same fitness in whole body:</td>

					</tr>

					<tr align="left">

						<td align="left" <?php if($row['gh08_a_1'] == ''){?>bgcolor="#F7A244"<?php }?> >01. Whole Body is fit<br />

							<input type="radio" name="gh08_a_1" value="1" <?php if($row['gh08_a_1'] == 1||$row['gh08_a_1'] == ''){?>checked="checked" <?php }?>/> 1-Yes

							<input type="radio" name="gh08_a_1" value="2" <?php if($row['gh08_a_1'] == 2){?>checked="checked" <?php }?>/> 2-No						

			

						</td>

				   </tr>

				   <tr align="left">

						<td align="left" <?php if($row['gh08_a_2'] == ''){?>bgcolor="#F7A244"<?php }?> >02. Problem in right hand/arm<br />

							<input type="radio" name="gh08_a_2" value="1" <?php if($row['gh08_a_2'] == 1){?>checked="checked" <?php }?>/> 1-Yes

							<input type="radio" name="gh08_a_2" value="2" <?php if($row['gh08_a_2'] == 2||$row['gh08_a_2'] == ''){?>checked="checked" <?php }?>/> 2-No						

			

						</td>

				   </tr>

				   <tr align="left">

						<td align="left" <?php if($row['gh08_a_3'] == ''){?>bgcolor="#F7A244"<?php }?> >03. Problem in left hand/arm<br />

							<input type="radio" name="gh08_a_3" value="1" <?php if($row['gh08_a_3'] == 1){?>checked="checked" <?php }?>/> 1-Yes

							<input type="radio" name="gh08_a_3" value="2" <?php if($row['gh08_a_3'] == 2||$row['gh08_a_3'] == ''){?>checked="checked" <?php }?>/> 2-No						

			

						</td>

				   </tr>

				   <tr align="left">

						<td align="left" <?php if($row['gh08_a_4'] == ''){?>bgcolor="#F7A244"<?php }?> >04. Problem in both hand/arm<br />

							<input type="radio" name="gh08_a_4" value="1" <?php if($row['gh08_a_4'] == 1){?>checked="checked" <?php }?>/> 1-Yes

							<input type="radio" name="gh08_a_4" value="2" <?php if($row['gh08_a_4'] == 2||$row['gh08_a_4'] == ''){?>checked="checked" <?php }?>/> 2-No						

			

						</td>

				   </tr>

				   <tr align="left">

						<td align="left" <?php if($row['gh08_a_5'] == ''){?>bgcolor="#F7A244"<?php }?> >05. Problem in right leg <br />

							<input type="radio" name="gh08_a_5" value="1" <?php if($row['gh08_a_5'] == 1){?>checked="checked" <?php }?>/> 1-Yes

							<input type="radio" name="gh08_a_5" value="2" <?php if($row['gh08_a_5'] == 2||$row['gh08_a_5'] == ''){?>checked="checked" <?php }?>/> 2-No						

			

						</td>

				   </tr>

				   <tr align="left">

						<td align="left" <?php if($row['gh08_a_6'] == ''){?>bgcolor="#F7A244"<?php }?> >06. Problem in left leg <br />

							<input type="radio" name="gh08_a_6" value="1" <?php if($row['gh08_a_6'] == 1){?>checked="checked" <?php }?>/> 1-Yes

							<input type="radio" name="gh08_a_6" value="2" <?php if($row['gh08_a_6'] == 2||$row['gh08_a_6'] == ''){?>checked="checked" <?php }?>/> 2-No						

			

						</td>

				   </tr>

				   <tr align="left">

						<td align="left" <?php if($row['gh08_a_7'] == ''){?>bgcolor="#F7A244"<?php }?> >07. Problem in both leg <br />

							<input type="radio" name="gh08_a_7" value="1" <?php if($row['gh08_a_7'] == 1){?>checked="checked" <?php }?>/> 1-Yes

							<input type="radio" name="gh08_a_7" value="2" <?php if($row['gh08_a_7'] == 2||$row['gh08_a_7'] == ''){?>checked="checked" <?php }?>/> 2-No						

			

						</td>

				   </tr>

				   <tr align="left">

						<td align="left" <?php if($row['gh08_a_8'] == ''){?>bgcolor="#F7A244"<?php }?> >08. Problem in back/waist<br />

							<input type="radio" name="gh08_a_8" value="1" <?php if($row['gh08_a_8'] == 1){?>checked="checked" <?php }?>/> 1-Yes

							<input type="radio" name="gh08_a_8" value="2" <?php if($row['gh08_a_8'] == 2||$row['gh08_a_8'] == ''){?>checked="checked" <?php }?>/> 2-No						

			

						</td>

				   </tr>

				   <tr align="left">

						<td align="left" <?php if($row['gh08_a_9'] == ''){?>bgcolor="#F7A244"<?php }?> >09. Fully Paralysed<br />

							<input type="radio" name="gh08_a_9" value="1" <?php if($row['gh08_a_9'] == 1){?>checked="checked" <?php }?>/> 1-Yes

							<input type="radio" name="gh08_a_9" value="2" <?php if($row['gh08_a_9'] == 2||$row['gh08_a_9'] == ''){?>checked="checked" <?php }?>/> 2-No						

			

						</td>

				   </tr>

					<tr>

							<td  align="right">

								<input type="submit" value="Next" class="input-box" />&nbsp;

							</td>

					</tr>	

				</table>

		</form>

	<?php } ?>

	<?php if ($serial=='cm01a1'){ 

				$sql="SELECT cm01a1_1, cm01a1_2, cm01a1_3, cm01a1_4, cm01a1_5, cm01a1_6, cm01a1_7, cm01a1_8, cm01a1_9, cm01a1_10, cm01a1_11, cm01a1_12, cm01a1_13, cm01a1_14, cm01a1_15, cm01a1_16, cm01a1_17, cm01a1_18, cm01a1_19, cm01a1_20, cm01a1_21, cm01a1_22 FROM chronic WHERE hid = '$hid' and resp_id = '$respondent'";

				$result = mysql_query($sql) or die ("problem budget_heads");

				$row = mysql_fetch_assoc($result);

				//echo "<pre>";

				//print_r($row );

		?>

				<form action="answer.php?qus=cm01a1" method="post">

				<table align="center" class="table_border" >

					<tr align="left">

							<td align="left" valign="top"> CHRONIC MORBIDITY:</td>

					</tr>

					<tr align="left">

							<td align="left" valign="top"> Symptoms:</td>

					</tr>

					<tr align="left">

							<td align="left" valign="top">CMO1a1_1: Breathing prblm:</td>

					</tr>

					<tr align="left">

							<td align="left" <?php if($row['cm01a1_1'] == ''||$row['cm01a1_1'] == '0'){?>bgcolor="#F7A244"<?php }?>>

								<select name="cm01a1[1]">

									 <?php

											if($row['cm01a1_1'] == ''||$row['cm01a1_1'] == '0'){

											 echo "<option value='0'> Select</option>";

											}

											else{

												$hop=$row['cm01a1_1'];

												$sql1="SELECT value from retreive_data WHERE qus='spn01_a' and hoption='$hop' ";

												$result1= mysql_query($sql1) or die ("problem 2ND BLOCK OF RESPONDENT");

												$value = mysql_fetch_assoc($result1);

												$mv= $value['value'];

												echo "<option value='$hop' selected='selected'> $hop-$mv</option>";

											}

										?>

									<option value="1">1-Yes</option>

									<option value="3" selected="selected">3-No</option>

								</select>					

							</td>

					</tr>

					<tr align="left">

							<td align="left" valign="top">CMO1a1_2:Loss of appetite:</td>

					</tr>

					<tr align="left">

							<td align="left" <?php if($row['cm01a1_2'] == ''||$row['cm01a1_2'] == '0'){?>bgcolor="#F7A244"<?php }?>>

								<select name="cm01a1[2]">

									 <?php

											if($row['cm01a1_2'] == ''||$row['cm01a1_2'] == '0'){

											 echo "<option value='0'> Select</option>";

											}

											else{

												$hop=$row['cm01a1_2'];

												$sql1="SELECT value from retreive_data WHERE qus='spn01_a' and hoption='$hop' ";

												$result1= mysql_query($sql1) or die ("problem 2ND BLOCK OF RESPONDENT");

												$value = mysql_fetch_assoc($result1);

												$mv= $value['value'];

												echo "<option value='$hop' selected='selected'> $hop-$mv</option>";

											}

										?>

									<option value="1">1-Yes</option>

									<option value="3" selected="selected">3-No</option>

								</select>					

							</td>

					</tr>

					<tr align="left">

							<td align="left" valign="top">CMO1a1_3: Loss of weight :</td>

					</tr>

					<tr align="left">

							<td align="left" <?php if($row['cm01a1_3'] == ''||$row['cm01a1_3'] == '0'){?>bgcolor="#F7A244"<?php }?>>

								<select name="cm01a1[3]">

									 <?php

											if($row['cm01a1_3'] == ''||$row['cm01a1_3'] == '0'){

											 echo "<option value='0'> Select</option>";

											}

											else{

												$hop=$row['cm01a1_3'];

												$sql1="SELECT value from retreive_data WHERE qus='spn01_a' and hoption='$hop' ";

												$result1= mysql_query($sql1) or die ("problem 2ND BLOCK OF RESPONDENT");

												$value = mysql_fetch_assoc($result1);

												$mv= $value['value'];

												echo "<option value='$hop' selected='selected'> $hop-$mv</option>";

											}

										?>

									<option value="1">1-Yes</option>

									<option value="3" selected="selected">3-No</option>

								</select>					

							</td>

					</tr>

					<tr align="left">

							<td align="left" valign="top">CMO1a1_4: Chest pain :</td>

					</tr>

					<tr align="left">

							<td align="left" <?php if($row['cm01a1_4'] == ''||$row['cm01a1_4'] == '0'){?>bgcolor="#F7A244"<?php }?>>

								<select name="cm01a1[4]">

									 <?php

											if($row['cm01a1_4'] == ''||$row['cm01a1_4'] == '0'){

											 echo "<option value='0'> Select</option>";

											}

											else{

												$hop=$row['cm01a1_4'];

												$sql1="SELECT value from retreive_data WHERE qus='spn01_a' and hoption='$hop' ";

												$result1= mysql_query($sql1) or die ("problem 2ND BLOCK OF RESPONDENT");

												$value = mysql_fetch_assoc($result1);

												$mv= $value['value'];

												echo "<option value='$hop' selected='selected'> $hop-$mv</option>";

											}

										?>

									<option value="1">1-Yes</option>

									<option value="3" selected="selected">3-No</option>

								</select>					

							</td>

					</tr>

					<tr align="left">

							<td align="left" valign="top">CMO1a1_5:Migrain/Headache:</td>

					</tr>

					<tr align="left">

							<td align="left" <?php if($row['cm01a1_5'] == ''||$row['cm01a1_5'] == '0'){?>bgcolor="#F7A244"<?php }?>>

								<select name="cm01a1[5]">

									 <?php

											if($row['cm01a1_5'] == ''||$row['cm01a1_5'] == '0'){

											 echo "<option value='0'> Select</option>";

											}

											else{

												$hop=$row['cm01a1_5'];

												$sql1="SELECT value from retreive_data WHERE qus='spn01_a' and hoption='$hop' ";

												$result1= mysql_query($sql1) or die ("problem 2ND BLOCK OF RESPONDENT");

												$value = mysql_fetch_assoc($result1);

												$mv= $value['value'];

												echo "<option value='$hop' selected='selected'> $hop-$mv</option>";

											}

										?>

									<option value="1">1-Yes</option>

									<option value="3" selected="selected">3-No</option>

								</select>					

							</td>

					</tr>

					<tr align="left">

							<td align="left" valign="top">CMO1a1_6: Blood in cough:</td>

					</tr>

					<tr align="left">

							<td align="left" <?php if($row['cm01a1_6'] == ''||$row['cm01a1_6'] == '0'){?>bgcolor="#F7A244"<?php }?>>

								<select name="cm01a1[6]">

									 <?php

											if($row['cm01a1_6'] == ''||$row['cm01a1_6'] == '0'){

											 echo "<option value='0'> Select</option>";

											}

											else{

												$hop=$row['cm01a1_6'];

												$sql1="SELECT value from retreive_data WHERE qus='spn01_a' and hoption='$hop' ";

												$result1= mysql_query($sql1) or die ("problem 2ND BLOCK OF RESPONDENT");

												$value = mysql_fetch_assoc($result1);

												$mv= $value['value'];

												echo "<option value='$hop' selected='selected'> $hop-$mv</option>";

											}

										?>

									<option value="1">1-Yes</option>

									<option value="3" selected="selected">3-No</option>

								</select>					

							</td>

					</tr>

					<tr align="left">

							<td align="left" valign="top">CMO1a1_7: Stomach pain :</td>

					</tr>

					<tr align="left">

							<td align="left" <?php if($row['cm01a1_7'] == ''||$row['cm01a1_7'] == '0'){?>bgcolor="#F7A244"<?php }?>>

								<select name="cm01a1[7]">

									 <?php

											if($row['cm01a1_7'] == ''||$row['cm01a1_7'] == '0'){

											 echo "<option value='0'> Select</option>";

											}

											else{

												$hop=$row['cm01a1_7'];

												$sql1="SELECT value from retreive_data WHERE qus='spn01_a' and hoption='$hop' ";

												$result1= mysql_query($sql1) or die ("problem 2ND BLOCK OF RESPONDENT");

												$value = mysql_fetch_assoc($result1);

												$mv= $value['value'];

												echo "<option value='$hop' selected='selected'> $hop-$mv</option>";

											}

										?>

									<option value="1">1-Yes</option>

									<option value="3" selected="selected">3-No</option>

								</select>					

							</td>

					</tr>

					<tr align="left">

							<td align="left" valign="top">CMO1a1_8: Paralysis :</td>

					</tr>

					<tr align="left">

							<td align="left" <?php if($row['cm01a1_8'] == ''||$row['cm01a1_8'] == '0'){?>bgcolor="#F7A244"<?php }?>>

								<select name="cm01a1[8]">

									 <?php

											if($row['cm01a1_8'] == ''||$row['cm01a1_8'] == '0'){

											 echo "<option value='0'> Select</option>";

											}

											else{

												$hop=$row['cm01a1_18'];

												$sql1="SELECT value from retreive_data WHERE qus='spn01_a' and hoption='$hop' ";

												$result1= mysql_query($sql1) or die ("problem 2ND BLOCK OF RESPONDENT");

												$value = mysql_fetch_assoc($result1);

												$mv= $value['value'];

												echo "<option value='$hop' selected='selected'> $hop-$mv</option>";

											}

										?>

									<option value="1">1-Yes</option>

									<option value="3" selected="selected">3-No</option>

								</select>					

							</td>

					</tr>

					<tr align="left">

							<td align="left" valign="top">CMO1a1_9: Sores :</td>

					</tr>

					<tr align="left">

							<td align="left" <?php if($row['cm01a1_9'] == ''||$row['cm01a1_9'] == '0'){?>bgcolor="#F7A244"<?php }?>>

								<select name="cm01a1[9]">

									 <?php

											if($row['cm01a1_9'] == ''||$row['cm01a1_9'] == '0'){

											 echo "<option value='0'> Select</option>";

											}

											else{

												$hop=$row['cm01a1_9'];

												$sql1="SELECT value from retreive_data WHERE qus='spn01_a' and hoption='$hop' ";

												$result1= mysql_query($sql1) or die ("problem 2ND BLOCK OF RESPONDENT");

												$value = mysql_fetch_assoc($result1);

												$mv= $value['value'];

												echo "<option value='$hop' selected='selected'> $hop-$mv</option>";

											}

										?>

									<option value="1">1-Yes</option>

									<option value="3" selected="selected">3-No</option>

								</select>					

							</td>

					</tr>

					<tr align="left">

							<td align="left" valign="top">CMO1a1_10: Urine Pain :</td>

					</tr>

					<tr align="left">

							<td align="left" <?php if($row['cm01a1_10'] == ''||$row['cm01a1_10'] == '0'){?>bgcolor="#F7A244"<?php }?>>

								<select name="cm01a1[10]">

									 <?php

											if($row['cm01a1_10'] == ''||$row['cm01a1_10'] == '0'){

											 echo "<option value='0'> Select</option>";

											}

											else{

												$hop=$row['cm01a1_10'];

												$sql1="SELECT value from retreive_data WHERE qus='spn01_a' and hoption='$hop' ";

												$result1= mysql_query($sql1) or die ("problem 2ND BLOCK OF RESPONDENT");

												$value = mysql_fetch_assoc($result1);

												$mv= $value['value'];

												echo "<option value='$hop' selected='selected'> $hop-$mv</option>";

											}

										?>

									<option value="1">1-Yes</option>

									<option value="3" selected="selected">3-No</option>

								</select>					

							</td>

					</tr>

					

					<tr align="left">

							<td align="left" valign="top"> Diseases:</td>

					</tr>

					<tr align="left">

							<td align="left" valign="top">CMO1b1_1: Heart Disease :</td>

					</tr>

					<tr align="left">

							<td align="left" <?php if($row['cm01a1_11'] == ''||$row['cm01a1_11'] == '0'){?>bgcolor="#F7A244"<?php }?>>

								<select name="cm01a1[11]">

									 <?php

											if($row['cm01a1_11'] == ''||$row['cm01a1_11'] == '0'){

											 echo "<option value='0'> Select</option>";

											}

											else{

												$hop=$row['cm01a1_11'];

												$sql1="SELECT value from retreive_data WHERE qus='spn01_a' and hoption='$hop' ";

												$result1= mysql_query($sql1) or die ("problem 2ND BLOCK OF RESPONDENT");

												$value = mysql_fetch_assoc($result1);

												$mv= $value['value'];

												echo "<option value='$hop' selected='selected'> $hop-$mv</option>";

											}

										?>

									<option value="1">1-Yes</option>

									<option value="3" selected="selected">3-No</option>

								</select>					

							</td>

					</tr>

					<tr align="left">

							<td align="left" valign="top">CMO1b1_2: Diabetes :</td>

					</tr>

					<tr align="left">

							<td align="left" <?php if($row['cm01a1_12'] == ''||$row['cm01a1_12'] == '0'){?>bgcolor="#F7A244"<?php }?>>

								<select name="cm01a1[12]">

									 <?php

											if($row['cm01a1_12'] == ''||$row['cm01a1_12'] == '0'){

											 echo "<option value='0'> Select</option>";

											}

											else{

												$hop=$row['cm01a1_12'];

												$sql1="SELECT value from retreive_data WHERE qus='spn01_a' and hoption='$hop' ";

												$result1= mysql_query($sql1) or die ("problem 2ND BLOCK OF RESPONDENT");

												$value = mysql_fetch_assoc($result1);

												$mv= $value['value'];

												echo "<option value='$hop' selected='selected'> $hop-$mv</option>";

											}

										?>

									<option value="1">1-Yes</option>

									<option value="3" selected="selected">3-No</option>

								</select>					

							</td>

					</tr>

					<tr align="left">

							<td align="left" valign="top">CMO1b1_3: Cancer :</td>

					</tr>

					<tr align="left">

							<td align="left" <?php if($row['cm01a1_13'] == ''||$row['cm01a1_13'] == '0'){?>bgcolor="#F7A244"<?php }?>>

								<select name="cm01a1[13]">

									 <?php

											if($row['cm01a1_13'] == ''||$row['cm01a1_13'] == '0'){

											 echo "<option value='0'> Select</option>";

											}

											else{

												$hop=$row['cm01a1_13'];

												$sql1="SELECT value from retreive_data WHERE qus='spn01_a' and hoption='$hop' ";

												$result1= mysql_query($sql1) or die ("problem 2ND BLOCK OF RESPONDENT");

												$value = mysql_fetch_assoc($result1);

												$mv= $value['value'];

												echo "<option value='$hop' selected='selected'> $hop-$mv</option>";

											}

										?>

									<option value="1">1-Yes</option>

									<option value="3" selected="selected">3-No</option>

								</select>					

							</td>

					</tr>

					<tr align="left">

							<td align="left" valign="top">CMO1b1_4: TB :</td>

					</tr>

					<tr align="left">

							<td align="left" <?php if($row['cm01a1_14'] == ''||$row['cm01a1_14'] == '0'){?>bgcolor="#F7A244"<?php }?>>

								<select name="cm01a1[14]">

									 <?php

											if($row['cm01a1_14'] == ''||$row['cm01a1_14'] == '0'){

											 echo "<option value='0'> Select</option>";

											}

											else{

												$hop=$row['cm01a1_14'];

												$sql1="SELECT value from retreive_data WHERE qus='spn01_a' and hoption='$hop' ";

												$result1= mysql_query($sql1) or die ("problem 2ND BLOCK OF RESPONDENT");

												$value = mysql_fetch_assoc($result1);

												$mv= $value['value'];

												echo "<option value='$hop' selected='selected'> $hop-$mv</option>";

											}

										?>

									<option value="1">1-Yes</option>

									<option value="3" selected="selected">3-No</option>

								</select>					

							</td>

					</tr>

					<tr align="left">

							<td align="left" valign="top">CMO1b1_5: Malaria :</td>

					</tr>

					<tr align="left">

							<td align="left" <?php if($row['cm01a1_15'] == ''||$row['cm01a1_15'] == '0'){?>bgcolor="#F7A244"<?php }?>>

								<select name="cm01a1[15]">

									 <?php

											if($row['cm01a1_15'] == ''||$row['cm01a1_15'] == '0'){

											 echo "<option value='0'> Select</option>";

											}

											else{

												$hop=$row['cm01a1_15'];

												$sql1="SELECT value from retreive_data WHERE qus='spn01_a' and hoption='$hop' ";

												$result1= mysql_query($sql1) or die ("problem 2ND BLOCK OF RESPONDENT");

												$value = mysql_fetch_assoc($result1);

												$mv= $value['value'];

												echo "<option value='$hop' selected='selected'> $hop-$mv</option>";

											}

										?>

									<option value="1">1-Yes</option>

									<option value="3" selected="selected">3-No</option>

								</select>					

							</td>

					</tr>

					<tr align="left">

							<td align="left" valign="top">CMO1b1_6: Arthritis :</td>

					</tr>

					<tr align="left">

							<td align="left" <?php if($row['cm01a1_16'] == ''||$row['cm01a1_16'] == '0'){?>bgcolor="#F7A244"<?php }?>>

								<select name="cm01a1[16]">

									 <?php

											if($row['cm01a1_16'] == ''||$row['cm01a1_16'] == '0'){

											 echo "<option value='0'> Select</option>";

											}

											else{

												$hop=$row['cm01a1_16'];

												$sql1="SELECT value from retreive_data WHERE qus='spn01_a' and hoption='$hop' ";

												$result1= mysql_query($sql1) or die ("problem 2ND BLOCK OF RESPONDENT");

												$value = mysql_fetch_assoc($result1);

												$mv= $value['value'];

												echo "<option value='$hop' selected='selected'> $hop-$mv</option>";

											}

										?>

									<option value="1">1-Yes</option>

									<option value="3" selected="selected">3-No</option>

								</select>					

							</td>

					</tr>

					<tr align="left">

							<td align="left" valign="top">CMO1b1_7: Gastric :</td>

					</tr>

					<tr align="left">

							<td align="left" <?php if($row['cm01a1_17'] == ''||$row['cm01a1_17'] == '0'){?>bgcolor="#F7A244"<?php }?>>

								<select name="cm01a1[17]">

									 <?php

											if($row['cm01a1_17'] == ''||$row['cm01a1_17'] == '0'){

											 echo "<option value='0'> Select</option>";

											}

											else{

												$hop=$row['cm01a1_17'];

												$sql1="SELECT value from retreive_data WHERE qus='spn01_a' and hoption='$hop' ";

												$result1= mysql_query($sql1) or die ("problem 2ND BLOCK OF RESPONDENT");

												$value = mysql_fetch_assoc($result1);

												$mv= $value['value'];

												echo "<option value='$hop' selected='selected'> $hop-$mv</option>";

											}

										?>

									<option value="1">1-Yes</option>

									<option value="3" selected="selected">3-No</option>

								</select>					

							</td>

					</tr>

					<tr align="left">

							<td align="left" valign="top">CMO1b1_8: Anaemia :</td>

					</tr>

					<tr align="left">

							<td align="left" <?php if($row['cm01a1_18'] == ''||$row['cm01a1_18'] == '0'){?>bgcolor="#F7A244"<?php }?>>

								<select name="cm01a1[18]">

									 <?php

											if($row['cm01a1_18'] == ''||$row['cm01a1_18'] == '0'){

											 echo "<option value='0'> Select</option>";

											}

											else{

												$hop=$row['cm01a1_18'];

												$sql1="SELECT value from retreive_data WHERE qus='spn01_a' and hoption='$hop' ";

												$result1= mysql_query($sql1) or die ("problem 2ND BLOCK OF RESPONDENT");

												$value = mysql_fetch_assoc($result1);

												$mv= $value['value'];

												echo "<option value='$hop' selected='selected'> $hop-$mv</option>";

											}

										?>

									<option value="1">1-Yes</option>

									<option value="3" selected="selected">3-No</option>

								</select>					

							</td>

					</tr>

					<tr align="left">

							<td align="left" valign="top">CMO1b1_9: Asthma :</td>

					</tr>

					<tr align="left">

							<td align="left" <?php if($row['cm01a1_19'] == ''||$row['cm01a1_19'] == '0'){?>bgcolor="#F7A244"<?php }?>>

								<select name="cm01a1[19]">

									 <?php

											if($row['cm01a1_19'] == ''||$row['cm01a1_19'] == '0'){

											 echo "<option value='0'> Select</option>";

											}

											else{

												$hop=$row['cm01a1_19'];

												$sql1="SELECT value from retreive_data WHERE qus='spn01_a' and hoption='$hop' ";

												$result1= mysql_query($sql1) or die ("problem 2ND BLOCK OF RESPONDENT");

												$value = mysql_fetch_assoc($result1);

												$mv= $value['value'];

												echo "<option value='$hop' selected='selected'> $hop-$mv</option>";

											}

										?>

									<option value="1">1-Yes</option>

									<option value="3" selected="selected">3-No</option>

								</select>					

							</td>

					</tr>

					<tr align="left">

							<td align="left" valign="top">CMO1b1_10: Fracture :</td>

					</tr>

					<tr align="left">

							<td align="left" <?php if($row['cm01a1_20'] == ''||$row['cm01a1_20'] == '0'){?>bgcolor="#F7A244"<?php }?>>

								<select name="cm01a1[20]">

									 <?php

											if($row['cm01a1_20'] == ''||$row['cm01a1_20'] == '0'){

											 echo "<option value='0'> Select</option>";

											}

											else{

												$hop=$row['cm01a1_20'];

												$sql1="SELECT value from retreive_data WHERE qus='spn01_a' and hoption='$hop' ";

												$result1= mysql_query($sql1) or die ("problem 2ND BLOCK OF RESPONDENT");

												$value = mysql_fetch_assoc($result1);

												$mv= $value['value'];

												echo "<option value='$hop' selected='selected'> $hop-$mv</option>";

											}

										?>

									<option value="1">1-Yes</option>

									<option value="3" selected="selected">3-No</option>

								</select>					

							</td>

					</tr>

					<tr align="left">

							<td align="left" valign="top">CMO1b1_11: Hypertension :</td>

					</tr>

					<tr align="left">

							<td align="left" <?php if($row['cm01a1_21'] == ''||$row['cm01a1_21'] == '0'){?>bgcolor="#F7A244"<?php }?>>

								<select name="cm01a1[21]">

									 <?php

											if($row['cm01a1_21'] == ''||$row['cm01a1_21'] == '0'){

											 echo "<option value='0'> Select</option>";

											}

											else{

												$hop=$row['cm01a1_21'];

												$sql1="SELECT value from retreive_data WHERE qus='spn01_a' and hoption='$hop' ";

												$result1= mysql_query($sql1) or die ("problem 2ND BLOCK OF RESPONDENT");

												$value = mysql_fetch_assoc($result1);

												$mv= $value['value'];

												echo "<option value='$hop' selected='selected'> $hop-$mv</option>";

											}

										?>

									<option value="1">1-Yes</option>

									<option value="3" selected="selected">3-No</option>

								</select>					

							</td>

					</tr>

					<tr align="left">

							<td align="left" valign="top">CMO1b1_12: Stroke :</td>

					</tr>

					<tr align="left">

							<td align="left" <?php if($row['cm01a1_22'] == ''||$row['cm01a1_22'] == '0'){?>bgcolor="#F7A244"<?php }?>>

								<select name="cm01a1[22]">

									 <?php

											if($row['cm01a1_22'] == ''||$row['cm01a1_22'] == '0'){

											 echo "<option value='0'> Select</option>";

											}

											else{

												$hop=$row['cm01a1_22'];

												$sql1="SELECT value from retreive_data WHERE qus='spn01_a' and hoption='$hop' ";

												$result1= mysql_query($sql1) or die ("problem 2ND BLOCK OF RESPONDENT");

												$value = mysql_fetch_assoc($result1);

												$mv= $value['value'];

												echo "<option value='$hop' selected='selected'> $hop-$mv</option>";

											}

										?>

									<option value="1">1-Yes</option>

									<option value="3" selected="selected">3-No</option>

								</select>					

							</td>

					</tr>

					

					<tr>

							<td  align="right">

								<input type="submit" value="Next" class="input-box" />&nbsp;

							</td>

					</tr>	

				</table>

		</form>

		<?php } ?>

		<?php if ($serial=='cm'){ 

				$no=$_GET['no'];

				

				$sql="SELECT  cm01a2_$no, cm02a_$no, cm03a_$no, cm04a_$no, cm05a_$no, cm06a_$no FROM chronic WHERE hid = '$hid' and resp_id = '$respondent'";

				$result = mysql_query($sql) or die ("problem budget_heads");

				$row = mysql_fetch_assoc($result);

				

				$rql="SELECT * FROM retreive_data WHERE hoption ='1' and qus='cm01a2_$no'";

				$ret_result = mysql_query($rql) or die ("problem budget_heads");

				$ret_row = mysql_fetch_assoc($ret_result);

				if($no<11){

				

				//echo "<pre>";

				//print_r($row );

		?>

				<form action="answer.php?qus=cm" method="post">

				<input type="hidden" name="no" value="<?php echo $no;?>" />

				<table align="center" class="table_border" >

					<tr align="left">

							<td align="left" valign="top"> CHRONIC MORBIDITY:</td>

					</tr>

					<tr align="left">

							<td align="left" valign="top"><?php echo $ret_row['value'];?> :</td>

					</tr>

					<tr align="left">

							<td align="left" valign="top">CMO1a2_<?php echo $no;?>: Currently has symptoms</td>

					</tr>

					

					<tr align="left">

							<td align="left" <?php if($row["cm01a2_$no"] == ''||$row["cm01a2_$no"] == '0'){?>bgcolor="#F7A244"<?php }?>>

								<select name="cm01a2_<?php echo $no;?>">

									 <?php

											if($row["cm01a2_$no"] == ''||$row["cm01a2_$no"] == '0'){

											 echo "<option value='0' selected='selected'> Select</option>";

											}

											else{

												$hop=$row["cm01a2_$no"];

												$sql1="SELECT value from retreive_data WHERE qus='spn01_a' and hoption='$hop' ";

												$result1= mysql_query($sql1) or die ("problem 2ND BLOCK OF RESPONDENT");

												$value = mysql_fetch_assoc($result1);

												$mv= $value['value'];

												echo "<option value='$hop' selected='selected'> $hop-$mv</option>";

											}

										?>

									<option value="1">1-Yes</option>

									<option value="3">3-No</option>

								</select>					

							</td>

					</tr>

					<tr align="left">

							<td align="left" valign="top">CMO2a_<?php echo $no;?> : Since when? </td>

					</tr>

					<tr align="left">

							<td align="left" <?php if($row["cm02a_$no"] == ''||$row["cm02a_$no"] == '0'){?>bgcolor="#F7A244"<?php }?>>

								<select name="cm02a_<?php echo $no;?>">

									 <?php

											if($row["cm02a_$no"] == ''||$row["cm02a_$no"] == '0'){

											 echo "<option value='0' selected='selected'> Select</option>";

											}

											else{

												$hop=$row["cm02a_$no"];

												$sql1="SELECT value from retreive_data WHERE qus='cm02a' and hoption='$hop' ";

												$result1= mysql_query($sql1) or die ("problem 2ND BLOCK OF RESPONDENT");

												$value = mysql_fetch_assoc($result1);

												$mv= $value['value'];

												echo "<option value='$hop' selected='selected'> $hop.&nbsp;$mv</option>";

											}

										?>

									<option value="1">1. less 3 M</option>

									<option value="2">2. 3-12 M</option>

									<option value="3">3. 1-2 Y</option>

									<option value="4">4. 2-5 Y</option>

									<option value="5">5. 5+ Y</option>

								</select>					

							</td>

					</tr>

					<tr align="left">

							<td align="left" valign="top">CMO3a_<?php echo $no;?>: Affecting regulr performance (3mnths)</td>

					</tr>

					<tr align="left">

							<td align="left" <?php if($row["cm03a_$no"] == ''||$row["cm03a_$no"] == '0'){?>bgcolor="#F7A244"<?php }?>>

								<select name="cm03a_<?php echo $no;?>">

									 <?php

											if($row["cm03a_$no"] == ''||$row["cm03a_$no"] == '0'){

											 echo "<option value='0' selected='selected'> Select</option>";

											}

											else{

												$hop=$row["cm03a_$no"];

												$sql1="SELECT value from retreive_data WHERE qus='cm03a' and hoption='$hop' ";

												$result1= mysql_query($sql1) or die ("problem 2ND BLOCK OF RESPONDENT");

												$value = mysql_fetch_assoc($result1);

												$mv= $value['value'];

												echo "<option value='$hop' selected='selected'> $hop-$mv</option>";

											}

										?>

									<option value="1">1- No</option>

									<option value="2">2- Yes</option>

									<option value="3">3- Some</option>

									<option value="4">4- Total(Disable)</option>

								</select>					

							</td>

					</tr>

					<tr align="left">

							<td align="left" valign="top">CMO4a_<?php echo $no;?>: Taken medicine/injection (3mnths)</td>

					</tr>

					

					<tr align="left">

							<td align="left" <?php if($row["cm04a_$no"] == ''||$row["cm04a_$no"] == '0'){?>bgcolor="#F7A244"<?php }?>>

								<select name="cm04a_<?php echo $no;?>">

									 <?php

											if($row["cm04a_$no"] == ''||$row["cm04a_$no"] == '0'){

											 echo "<option value='0' selected='selected'> Select</option>";

											}

											else{

												$hop=$row["cm04a_$no"];

												$sql1="SELECT value from retreive_data WHERE qus='spn01_a' and hoption='$hop' ";

												$result1= mysql_query($sql1) or die ("problem 2ND BLOCK OF RESPONDENT");

												$value = mysql_fetch_assoc($result1);

												$mv= $value['value'];

												echo "<option value='$hop' selected='selected'> $hop-$mv</option>";

											}

										?>

									<option value="1">1-Yes</option>

									<option value="3">3-No</option>

								</select>					

							</td>

					</tr>

					<tr align="left">

							<td align="left" valign="top">CMO5a_<?php echo $no;?>: Doctor visited(3mnths)</td>

					</tr>

					

					<tr align="left">

							<td align="left" <?php if($row["cm05a_$no"] == ''||$row["cm05a_$no"] == '0'){?>bgcolor="#F7A244"<?php }?>>

								<select name="cm05a_<?php echo $no;?>">

									 <?php

											if($row["cm05a_$no"] == ''||$row["cm05a_$no"] == '0'){

											 echo "<option value='0' selected='selected'> Select</option>";

											}

											else{

												$hop=$row["cm05a_$no"];

												$sql1="SELECT value from retreive_data WHERE qus='spn01_a' and hoption='$hop' ";

												$result1= mysql_query($sql1) or die ("problem 2ND BLOCK OF RESPONDENT");

												$value = mysql_fetch_assoc($result1);

												$mv= $value['value'];

												echo "<option value='$hop' selected='selected'> $hop-$mv</option>";

											}

										?>

									<option value="1">1-Yes</option>

									<option value="3">3-No</option>

								</select>					

							</td>

					</tr>

					<tr align="left">

							<td align="left" valign="top">CMO6a_<?php echo $no;?>: Hospitalised during last 1yr</td>

					</tr>

					

					<tr align="left">

							<td align="left" <?php if($row["cm06a_$no"] == ''||$row["cm06a_$no"] == '0'){?>bgcolor="#F7A244"<?php }?>>

								<select name="cm06a_<?php echo $no;?>">

									 <?php

											if($row["cm06a_$no"] == ''||$row["cm06a_$no"] == '0'){

											 echo "<option value='0' selected='selected'> Select</option>";

											}

											else{

												$hop=$row["cm06a_$no"];

												$sql1="SELECT value from retreive_data WHERE qus='spn01_a' and hoption='$hop' ";

												$result1= mysql_query($sql1) or die ("problem 2ND BLOCK OF RESPONDENT");

												$value = mysql_fetch_assoc($result1);

												$mv= $value['value'];

												echo "<option value='$hop' selected='selected'> $hop-$mv</option>";

											}

										?>

									<option value="1">1-Yes</option>

									<option value="3">3-No</option>

								</select>					

							</td>

					</tr>

					<tr>

							<td  align="right">

								<input type="submit" value="Next" class="input-box" />&nbsp;

							</td>

					</tr>	

				</table>

		</form>

		<?php }else{?>

		<form action="answer.php?qus=cm" method="post">

				<input type="hidden" name="no" value="<?php echo $no;?>" />

				<table align="center" class="table_border" >

					<tr align="left">

							<td align="left" valign="top"> CHRONIC MORBIDITY:</td>

					</tr>

					<tr align="left">

							<td align="left" valign="top"><?php echo $ret_row['value'];?> :</td>

					</tr>

					<tr align="left">

							<td align="left" valign="top">CMO1b_<?php echo $no-10;;?>:Did your doc/paramedic tell you about diseases?</td>

					</tr>

					

					<tr align="left">

							<td align="left" <?php if($row["cm01a2_$no"] == ''||$row["cm01a2_$no"] == '0'){?>bgcolor="#F7A244"<?php }?>>

								<select name="cm01a2_<?php echo $no;?>">

									 <?php

											if($row["cm01a2_$no"] == ''||$row["cm01a2_$no"] == '0'){

											 echo "<option value='0' selected='selected'> Select</option>";

											}

											else{

												$hop=$row["cm01a2_$no"];

												$sql1="SELECT value from retreive_data WHERE qus='spn01_a' and hoption='$hop' ";

												$result1= mysql_query($sql1) or die ("problem 2ND BLOCK OF RESPONDENT");

												$value = mysql_fetch_assoc($result1);

												$mv= $value['value'];

												echo "<option value='$hop' selected='selected'> $hop-$mv</option>";

											}

										?>

									<option value="1">1-Yes</option>

									<option value="3">3-No</option>

								</select>					

							</td>

					</tr>

					<tr align="left">

							<td align="left" valign="top">CMO2b_<?php echo $no-10;?> : Since when? </td>

					</tr>

					<tr align="left">

							<td align="left" <?php if($row["cm02a_$no"] == ''||$row["cm02a_$no"] == '0'){?>bgcolor="#F7A244"<?php }?>>

								<select name="cm02a_<?php echo $no;?>">

									 <?php

											if($row["cm02a_$no"] == ''||$row["cm02a_$no"] == '0'){

											 echo "<option value='0' selected='selected'> Select</option>";

											}

											else{

												$hop=$row["cm02a_$no"];

												$sql1="SELECT value from retreive_data WHERE qus='cm02a' and hoption='$hop' ";

												$result1= mysql_query($sql1) or die ("problem 2ND BLOCK OF RESPONDENT");

												$value = mysql_fetch_assoc($result1);

												$mv= $value['value'];

												echo "<option value='$hop' selected='selected'> $hop.&nbsp;$mv</option>";

											}

										?>

									<option value="1">1. less 3 Mnths</option>

									<option value="2">2. 3-12 Mnths</option>

									<option value="3">3. 1-2 Yrs</option>

									<option value="4">4. 2-5 Yrs</option>

									<option value="5">5. 5+ Yrs</option>

								</select>					

							</td>

					</tr>

					<tr align="left">

							<td align="left" valign="top">CMO3b_<?php echo $no-10;?>: Affecting regular performance (3mnths)</td>

					</tr>

					<tr align="left">

							<td align="left" <?php if($row["cm03a_$no"] == ''||$row["cm03a_$no"] == '0'){?>bgcolor="#F7A244"<?php }?>>

								<select name="cm03a_<?php echo $no;?>">

									 <?php

											if($row["cm03a_$no"] == ''||$row["cm03a_$no"] == '0'){

											 echo "<option value='0' selected='selected'> Select</option>";

											}

											else{

												$hop=$row["cm03a_$no"];

												$sql1="SELECT value from retreive_data WHERE qus='cm03a' and hoption='$hop' ";

												$result1= mysql_query($sql1) or die ("problem 2ND BLOCK OF RESPONDENT");

												$value = mysql_fetch_assoc($result1);

												$mv= $value['value'];

												echo "<option value='$hop' selected='selected'> $hop-$mv</option>";

											}

										?>

									<option value="1">1- No</option>

									<option value="2">2- Yes</option>

									<option value="3">3- Some</option>

									<option value="4">4- Total(Disable)</option>

								</select>					

							</td>

					</tr>

					<tr align="left">

							<td align="left" valign="top">CMO4b_<?php echo $no-10;?>: Taken medicine/injection (3mnths)</td>

					</tr>

					

					<tr align="left">

							<td align="left" <?php if($row["cm04a_$no"] == ''||$row["cm04a_$no"] == '0'){?>bgcolor="#F7A244"<?php }?>>

								<select name="cm04a_<?php echo $no;?>">

									 <?php

											if($row["cm04a_$no"] == ''||$row["cm04a_$no"] == '0'){

											 echo "<option value='0' selected='selected'> Select</option>";

											}

											else{

												$hop=$row["cm04a_$no"];

												$sql1="SELECT value from retreive_data WHERE qus='spn01_a' and hoption='$hop' ";

												$result1= mysql_query($sql1) or die ("problem 2ND BLOCK OF RESPONDENT");

												$value = mysql_fetch_assoc($result1);

												$mv= $value['value'];

												echo "<option value='$hop' selected='selected'> $hop-$mv</option>";

											}

										?>

									<option value="1">1-Yes</option>

									<option value="3">3-No</option>

								</select>					

							</td>

					</tr>

					<tr align="left">

							<td align="left" valign="top">CMO5b_<?php echo $no-10;?>: Consulting Doctor(last 3mnths)</td>

					</tr>

					

					<tr align="left">

							<td align="left" <?php if($row["cm05a_$no"] == ''||$row["cm05a_$no"] == '0'){?>bgcolor="#F7A244"<?php }?>>

								<select name="cm05a_<?php echo $no;?>">

									 <?php

											if($row["cm05a_$no"] == ''||$row["cm05a_$no"] == '0'){

											 echo "<option value='0' selected='selected'> Select</option>";

											}

											else{

												$hop=$row["cm05a_$no"];

												$sql1="SELECT value from retreive_data WHERE qus='spn01_a' and hoption='$hop' ";

												$result1= mysql_query($sql1) or die ("problem 2ND BLOCK OF RESPONDENT");

												$value = mysql_fetch_assoc($result1);

												$mv= $value['value'];

												echo "<option value='$hop' selected='selected'> $hop-$mv</option>";

											}

										?>

									<option value="1">1-Yes</option>

									<option value="3">3-No</option>

								</select>					

							</td>

					</tr>

					<tr align="left">

							<td align="left" valign="top">CMO6b_<?php echo $no-10;?>: Hospitalised during last 1yr</td>

					</tr>

					

					<tr align="left">

							<td align="left" <?php if($row["cm06a_$no"] == ''||$row["cm06a_$no"] == '0'){?>bgcolor="#F7A244"<?php }?>>

								<select name="cm06a_<?php echo $no;?>">

									 <?php

											if($row["cm06a_$no"] == ''||$row["cm06a_$no"] == '0'){

											 echo "<option value='0' selected='selected'> Select</option>";

											}

											else{

												$hop=$row["cm06a_$no"];

												$sql1="SELECT value from retreive_data WHERE qus='spn01_a' and hoption='$hop' ";

												$result1= mysql_query($sql1) or die ("problem 2ND BLOCK OF RESPONDENT");

												$value = mysql_fetch_assoc($result1);

												$mv= $value['value'];

												echo "<option value='$hop' selected='selected'> $hop-$mv</option>";

											}

										?>

									<option value="1">1-Yes</option>

									<option value="3">3-No</option>

								</select>					

							</td>

					</tr>

					<tr>

							<td  align="right">

								<input type="submit" value="Next" class="input-box" />&nbsp;

							</td>

					</tr>	

				</table>

		</form>

		<?php }?>

		<?php } ?>

		<?php if ($serial=='cm13'){ 

				//$no=$_GET['no'];

				

		?>

		<form action="answer.php?qus=cm13" method="post">

				<table align="center" class="table_border" >

					<tr align="left">

							<td align="left" valign="top"> CHRONIC MORBIDITY:</td>

					</tr>

					<tr align="left">

							<td align="left" valign="top">CM13:&nbsp; Happening last 12 mnths</td>

					</tr>

					<?php for($no=1;$no<=17;$no++){ 

							$sql="SELECT  cm13_$no FROM chronic WHERE hid = '$hid' and resp_id = '$respondent'";

							$result = mysql_query($sql) or die ("problem budget_heads");

							$row = mysql_fetch_assoc($result);

							

							$rql="SELECT * FROM retreive_data WHERE hoption ='1' and qus='cm13_$no'";

							$ret_result = mysql_query($rql) or die ("problem budget_heads");

							$ret_row = mysql_fetch_assoc($ret_result);

					?>

					<tr align="left">

							<td align="left" valign="top"><?php echo $ret_row['value']; ?>:</td>

					</tr>

					<tr align="left">

							<td align="left" <?php if($row["cm13_$no"] == ''||$row["cm13_$no"] == '0'){?>bgcolor="#F7A244"<?php }?>>

								<select name="cm13[<?php echo $no;?>]">

									 <?php

											if($row["cm13_$no"] == ''||$row["cm13_$no"] == '0'){

											 echo "<option value='0' selected='selected'> Select</option>";

											}

											else{

												$hop=$row["cm13_$no"];

												$sql1="SELECT value from retreive_data WHERE qus='cm13' and hoption='$hop' ";

												$result1= mysql_query($sql1) or die ("problem 2ND BLOCK OF RESPONDENT");

												$value = mysql_fetch_assoc($result1);

												$mv= $value['value'];

												echo "<option value='$hop' selected='selected'> $hop-$mv</option>";

											}

										?>

									<option value="1">1-Yes</option>

									<option value="3" selected="selected">3-No</option>

									<!--<option value="8">8-NA</option>!-->

								</select>					

							</td>

					</tr>

					<?php }?>

					<tr>

							<td  align="right">

								<input type="submit" value="Next" class="input-box" />&nbsp;

							</td>

					</tr>	

				</table>

		</form>

		<?php } ?>

		<?php if ($serial=='cm14'){

				$sql="SELECT cm14 FROM chronic WHERE hid = '$hid' and resp_id = '$respondent'";

				$result = mysql_query($sql) or die ("problem budget_heads");

				$row = mysql_fetch_assoc($result);

		?>

				<form action="answer.php?qus=cm14" method="post">

				<table align="center" class="table_border" >

					<tr align="left">

							<td align="left" valign="top">CM14: Depressed continously 2 weeks? :</td>

					</tr>

					<tr align="left">

							<td align="left" <?php if($row['cm14'] == ''||$row['cm14'] == '0'){?>bgcolor="#F7A244"<?php }?>>

								<select name="cm14">

									 <?php

											if($row['cm14'] == ''||$row['cm14'] == '0'){

											 echo "<option value='0' selected='selected'> Select</option>";

											}

											else{

												$hop=$row['cm14'];

												$sql1="SELECT value from retreive_data WHERE qus='spn02_a' and hoption='$hop' ";

												$result1= mysql_query($sql1) or die ("problem 2ND BLOCK OF RESPONDENT");

												$value = mysql_fetch_assoc($result1);

												$mv= $value['value'];

												echo "<option value='$hop' selected='selected'> $hop-$mv</option>";

											}

										?>	

									<option value="1">1-Yes</option>

									<option value="3">3-No</option>

								</select>					

							</td>

						</tr>

						<tr>

							<td  align="right">

								<input type="submit" value="Next" class="input-box" />&nbsp;

							</td>

					</tr>

					</table>

		<?php }?>

		<?php if ($serial=='cm14_y'){ ?>

		<form action="answer.php?qus=cm14_y" method="post">

				<table align="center" class="table_border" >

					<tr align="left">

							<td align="left" valign="top"> CHRONIC MORBIDITY:</td>

					</tr>

					<?php for($no=1;$no<=7;$no++){ 

							$sql="SELECT  cm14_$no FROM chronic WHERE hid = '$hid' and resp_id = '$respondent'";

							$result = mysql_query($sql) or die ("problem budget_heads");

							$row = mysql_fetch_assoc($result);

							

							$rql="SELECT * FROM retreive_data WHERE hoption ='1' and qus='cm14_$no'";

							$ret_result = mysql_query($rql) or die ("problem budget_heads");

							$ret_row = mysql_fetch_assoc($ret_result);

					?>

					<tr align="left">

							<td align="left" valign="top"><?php echo $ret_row['value']; ?>&nbsp;?</td>

					</tr>

					<tr align="left">

							<td align="left" <?php if($row["cm14_$no"] == ''||$row["cm14_$no"] == '0'){?>bgcolor="#F7A244"<?php }?>>

								<select name="cm14[<?php echo $no;?>]">

									 <?php

											if($row["cm14_$no"] == ''||$row["cm14_$no"] == '0'){

											 echo "<option value='0' selected='selected'> Select</option>";

											}

											else{

												$hop=$row["cm14_$no"];

												$sql1="SELECT value from retreive_data WHERE qus='cm13' and hoption='$hop' ";

												$result1= mysql_query($sql1) or die ("problem 2ND BLOCK OF RESPONDENT");

												$value = mysql_fetch_assoc($result1);

												$mv= $value['value'];

												echo "<option value='$hop' selected='selected'> $hop-$mv</option>";

											}

										?>

									<option value="1">1-Yes</option>

									<option value="3">3-No</option>

							<!--	<option value="8">8-NA</option>		!-->

								</select>					

							</td>

					</tr>

					<?php }?>

					<tr>

							<td  align="right">

								<input type="submit" value="Next" class="input-box" />&nbsp;

							</td>

					</tr>	

				</table>

		</form>

		<?php } ?>

		<?php if ($serial=='cm15'){

				$sql="SELECT cm15 FROM chronic WHERE hid = '$hid' and resp_id = '$respondent'";

				$result = mysql_query($sql) or die ("problem budget_heads");

				$row = mysql_fetch_assoc($result);

		?>

				<form action="answer.php?qus=cm15" method="post">

				<table align="center" class="table_border" >

					<tr align="left">

							<td align="left" valign="top">CM15: During last 12 mnths have u been injured? </td>

					</tr>

					<tr align="left">

							<td align="left" <?php if($row['cm15'] == ''||$row['cm15'] == '0'){?>bgcolor="#F7A244"<?php }?>>

								<select name="cm15">

									 <?php

											if($row['cm15'] == ''||$row['cm15'] == '0'){

											 echo "<option value='0' selected='selected'> Select</option>";

											}

											else{

												$hop=$row['cm15'];

												$sql1="SELECT value from retreive_data WHERE qus='spn02_a' and hoption='$hop' ";

												$result1= mysql_query($sql1) or die ("problem 2ND BLOCK OF RESPONDENT");

												$value = mysql_fetch_assoc($result1);

												$mv= $value['value'];

												echo "<option value='$hop' selected='selected'> $hop-$mv</option>";

											}

										?>	

									<option value="1">1-Yes</option>

									<option value="3">3-No</option>

								</select>					

							</td>

						</tr>

						<tr>

							<td  align="right">

								<input type="submit" value="Next" class="input-box" />&nbsp;

							</td>

					</tr>

					</table>

		<?php }?>

		<?php if ($serial=='cm15_y'){ ?>

		<form action="answer.php?qus=cm15_y" method="post">

				<table align="center" class="table_border" >

					<tr align="left">

							<td align="left" valign="top"> CHRONIC MORBIDITY:</td>

					</tr>

					<?php for($no=1;$no<=18;$no++){ 

							$sql="SELECT  cm15_$no FROM chronic WHERE hid = '$hid' and resp_id = '$respondent'";

							$result = mysql_query($sql) or die ("problem budget_heads");

							$row = mysql_fetch_assoc($result);

							

							$rql="SELECT * FROM retreive_data WHERE hoption ='1' and qus='cm15_$no'";

							$ret_result = mysql_query($rql) or die ("problem budget_heads");

							$ret_row = mysql_fetch_assoc($ret_result);

					?>

					<tr align="left">

							<td align="left" valign="top"><?php echo $ret_row['value']; ?>:</td>

					</tr>

					<tr align="left">

							<td align="left" <?php if($row["cm15_$no"] == ''||$row["cm15_$no"] == '0'){?>bgcolor="#F7A244"<?php }?>>

								<select name="cm15[<?php echo $no;?>]">

									 <?php

											if($row["cm15_$no"] == ''||$row["cm15_$no"] == '0'){

											 echo "<option value='0' selected='selected'> Select</option>";

											}

											else{

												$hop=$row["cm15_$no"];

												$sql1="SELECT value from retreive_data WHERE qus='spn02_a' and hoption='$hop' ";

												$result1= mysql_query($sql1) or die ("problem 2ND BLOCK OF RESPONDENT");

												$value = mysql_fetch_assoc($result1);

												$mv= $value['value'];

												echo "<option value='$hop' selected='selected'> $hop-$mv</option>";

											}

										?>

									<option value="1">1-Yes</option>

									<option value="3" selected="selected">3-No</option>

								</select>					

							</td>

					</tr>

					<?php }?>

					<tr>

							<td  align="right">

								<input type="submit" value="Next" class="input-box" />&nbsp;

							</td>

					</tr>	

				</table>

		</form>

		<?php } ?>

		<?php if ($serial=='cm15a'){ 

				$no=$_GET['no'];

				$sql="SELECT  cm15a_$no, cm15b_$no, cm15c_$no FROM chronic WHERE hid = '$hid' and resp_id = '$respondent'";

				$result = mysql_query($sql) or die ("problem budget_heads");

				$row = mysql_fetch_assoc($result);

				

				$rql="SELECT * FROM retreive_data WHERE hoption ='1' and qus='cm15_$no'";

				$ret_result = mysql_query($rql) or die ("problem budget_heads");

				$ret_row = mysql_fetch_assoc($ret_result);

				

				//echo "<pre>";

				//print_r($row );

		?>

				<form action="answer.php?qus=cm15a" method="post">

				<input type="hidden" name="no" value="<?php echo $no;?>" />

				<table align="center" class="table_border" >

					<tr align="left">

							<td align="left" valign="top"> CHRONIC MORBIDITY:</td>

					</tr>

					<tr align="left">

							<td align="left" valign="top"><?php echo $ret_row['value'];?> :</td>

					</tr>

					<tr align="left">

							<td align="left" valign="top">cm15_<?php echo $no;?>: Location of injury ?</td>

					</tr>

					

					<tr align="left">

							<td align="left" <?php if($row["cm15a_$no"] == ''||$row["cm15a_$no"] == '0'){?>bgcolor="#F7A244"<?php }?>>

								<select name="cm15a_<?php echo $no;?>">

									 <?php

											if($row["cm15a_$no"] == ''||$row["cm15a_$no"] == '0'){

											 echo "<option value='0' selected='selected'> Select</option>";

											}

											else{

												$hop=$row["cm15a_$no"];

												$sql1="SELECT value from retreive_data WHERE qus='cm15a' and hoption='$hop' ";

												$result1= mysql_query($sql1) or die ("problem 2ND BLOCK OF RESPONDENT");

												$value = mysql_fetch_assoc($result1);

												$mv= $value['value'];

												echo "<option value='$hop' selected='selected'> $hop-$mv</option>";

											}

										?>

									<?php for($i=1;$i<=10;$i++){

											$hop=$i;

											$sql1="SELECT value from retreive_data WHERE qus='cm15a' and hoption='$hop' ";

											$result1= mysql_query($sql1) or die ("problem 2ND BLOCK OF RESPONDENT");

											$value = mysql_fetch_assoc($result1);

											$mv= $value['value'];

											echo "<option value='$hop'> $hop-$mv</option>";

									} ?>

								</select>					

							</td>

					</tr>

					<tr align="left">

							<td align="left" valign="top">CM15_<?php echo $no;?> : Type of Injury ? </td>

					</tr>

					<tr align="left">

							<td align="left" <?php if($row["cm15b_$no"] == ''||$row["cm15b_$no"] == '0'){?>bgcolor="#F7A244"<?php }?>>

								<select name="cm15b_<?php echo $no;?>">

									 <?php

											if($row["cm15b_$no"] == ''||$row["cm15b_$no"] == '0'){

											 echo "<option value='0' selected='selected'> Select</option>";

											}

											else{

												$hop=$row["cm15b_$no"];

												$sql1="SELECT value from retreive_data WHERE qus='cm15b' and hoption='$hop' ";

												$result1= mysql_query($sql1) or die ("problem 2ND BLOCK OF RESPONDENT");

												$value = mysql_fetch_assoc($result1);

												$mv= $value['value'];

												echo "<option value='$hop' selected='selected'> $hop.&nbsp;$mv</option>";

											}

										?>

									<?php for($i=1;$i<=9;$i++){

											$hop=$i;

											$sql1="SELECT value from retreive_data WHERE qus='cm15b' and hoption='$hop' ";

											$result1= mysql_query($sql1) or die ("problem 2ND BLOCK OF RESPONDENT");

											$value = mysql_fetch_assoc($result1);

											$mv= $value['value'];

											echo "<option value='$hop'> $hop-$mv</option>";

									} ?>

								</select>					

							</td>

					</tr>

					<tr align="left">

							<td align="left" valign="top">CM15_<?php echo $no;?>: Absence from work</td>

					</tr>

					<tr align="left">

							<td align="left" <?php if($row["cm15c_$no"] == ''||$row["cm15c_$no"] == '000'){?>bgcolor="#F7A244"<?php }?>>

								<select name="d1">

									 <?php for($i=0;$i<=3;$i++){?>

									 <option value="<?php echo $i;?>"><?php echo $i;?></option>

									 <?php }?>

								</select>	

								<select name="d2">

									 <?php for($i=0;$i<=9;$i++){?>

									 <option value="<?php echo $i;?>"><?php echo $i;?></option>

									 <?php }?>

								</select>	

								<select name="d3">

									 <?php for($i=0;$i<=9;$i++){?>

									 <option value="<?php echo $i;?>"><?php echo $i;?></option>

									 <?php }?>

								</select>&nbsp;&nbsp;days					

							</td>

					</tr>

					<tr>

							<td  align="right">

								<input type="submit" value="Next" class="input-box" />&nbsp;

							</td>

					</tr>	

				</table>

		</form>

		<?php } ?>

		<?php if ($serial=='am01'){ ?>

		<form action="answer.php?qus=am01" method="post">

				<table align="center" class="table_border" >

					<tr align="left">

							<td align="left" valign="top"> ACUTE MORBIDITY:</td>

					</tr>

					<tr align="left">

							<td align="left" valign="top">AM01: Have you ever suffered from this during the past one month?</td>

					</tr>

					<?php for($no=1;$no<=12;$no++){ 

							$sql="SELECT  am01_$no FROM acute WHERE hid = '$hid' and resp_id = '$respondent'";

							$result = mysql_query($sql) or die ("problem budget_heads");

							$row = mysql_fetch_assoc($result);

							

							$rql="SELECT * FROM retreive_data WHERE hoption ='1' and qus='am_$no'";

							$ret_result = mysql_query($rql) or die ("problem budget_heads");

							$ret_row = mysql_fetch_assoc($ret_result);

					?>

					<tr align="left">

							<td align="left" valign="top"><?php echo $ret_row['value']; ?>:</td>

					</tr>

					<tr align="left">

							<td align="left" <?php if($row["am01_$no"] == ''||$row["am01_$no"] == '0'){?>bgcolor="#F7A244"<?php }?>>

								<select name="am[<?php echo $no;?>]">

									 <?php

											if($row["am01_$no"] == ''||$row["am01_$no"] == '0'){

											 echo "<option value='0' selected='selected'> Select</option>";

											}

											else{

												$hop=$row["am01_$no"];

												$sql1="SELECT value from retreive_data WHERE qus='spn02_a' and hoption='$hop' ";

												$result1= mysql_query($sql1) or die ("problem 2ND BLOCK OF RESPONDENT");

												$value = mysql_fetch_assoc($result1);

												$mv= $value['value'];

												echo "<option value='$hop' selected='selected'> $hop-$mv</option>";

											}

										?>

									<option value="1">1-Yes</option>

									<option value="3" selected="selected">3-No</option>

								</select>					

							</td>

					</tr>

					<?php }?>

					<tr>

							<td  align="right">

								<input type="submit" value="Next" class="input-box" />&nbsp;

							</td>

					</tr>	

				</table>

		</form>

		<?php } ?>

		<?php if ($serial=='am01a'){ 

				$no=$_GET['no'];

				$sql="SELECT  am03_$no, am05_$no, am06_$no FROM acute WHERE hid = '$hid' and resp_id = '$respondent'";

				$result = mysql_query($sql) or die ("problem budget_heads");

				$row = mysql_fetch_assoc($result);

				

				$rql="SELECT * FROM retreive_data WHERE hoption ='1' and qus='am_$no'";

				$ret_result = mysql_query($rql) or die ("problem budget_heads");

				$ret_row = mysql_fetch_assoc($ret_result);

				

				//echo "<pre>";

				//print_r($row );

		?>

				<form action="answer.php?qus=am01a" method="post">

				<input type="hidden" name="no" value="<?php echo $no;?>" />

				<table align="center" class="table_border" >

					<tr align="left">

							<td align="left" valign="top"> ACUTE MORBIDITY:</td>

					</tr>

					<tr align="left">

							<td align="left" valign="top"><?php echo $ret_row['value'];?> :</td>

					</tr>

					<tr align="left">

							<td align="left" valign="top">AM03: How long ago this symptom begin/accident happend? </td>

					</tr>

					

					<tr align="left">

							<td align="left" <?php if($row["am03_$no"] == ''||$row["am03_$no"] == '00'){?>bgcolor="#F7A244"<?php }?>>

								<select name="d1">

									 <?php for($i=0;$i<=9;$i++){?>

									 <option value="<?php echo $i;?>"><?php echo $i;?></option>

									 <?php }?>

								</select>	

								<select name="d2">

									 <?php for($i=0;$i<=9;$i++){?>

									 <option value="<?php echo $i;?>"><?php echo $i;?></option>

									 <?php }?>

								</select> &nbsp;&nbsp;days					

							</td>

					</tr>

					<tr align="left">

							<td align="left" valign="top">AM05: How many days in the past one month did you suffer ? </td>

					</tr>

					<tr align="left">

							<td align="left" <?php if($row["am05_$no"] == ''||$row["am05_$no"] == '00'){?>bgcolor="#F7A244"<?php }?>>

								<select name="d3">

									 <?php for($i=0;$i<=3;$i++){?>

									 <option value="<?php echo $i;?>"><?php echo $i;?></option>

									 <?php }?>

								</select>	

								<select name="d4">

									 <?php for($i=0;$i<=9;$i++){?>

									 <option value="<?php echo $i;?>"><?php echo $i;?></option>

									 <?php }?>

								</select> &nbsp;&nbsp;days						

							</td>

					</tr>

					<tr align="left">

							<td align="left" valign="top">AM06: Which type of health provider have you seen ?</td>

					</tr>

					<tr align="left">

							<td align="left" <?php if($row["am06_$no"] == ''||$row["am06_$no"] == '0'){?>bgcolor="#F7A244"<?php }?>>

								<select name="am06_<?php echo $no;?>">

									 <?php

											if($row["am06_$no"] == ''||$row["am06_$no"] == '0'){

											 echo "<option value='0' selected='selected'> Select</option>";

											}

											else{

												$hop=$row["am06_$no"];

												$sql1="SELECT value from retreive_data WHERE qus='am06' and hoption='$hop' ";

												$result1= mysql_query($sql1) or die ("problem 2ND BLOCK OF RESPONDENT");

												$value = mysql_fetch_assoc($result1);

												$mv= $value['value'];

												echo "<option value='$hop' selected='selected'> $hop.&nbsp;$mv</option>";

											}

										?>

									<?php for($i=1;$i<=18;$i++){

											$hop=$i;

											$sql1="SELECT value from retreive_data WHERE qus='am06' and hoption='$hop' ";

											$result1= mysql_query($sql1) or die ("problem 2ND BLOCK OF RESPONDENT");

											$value = mysql_fetch_assoc($result1);

											$mv= $value['value'];

											echo "<option value='$hop'> $hop-$mv</option>";

									} ?>

								</select>				

							</td>

					</tr>

					<tr>

							<td  align="right">

								<input type="submit" value="Next" class="input-box" />&nbsp;

							</td>

					</tr>	

				</table>

		</form>

		<?php } ?>

</body>

</html>